[PATCH] D126546: [InstCombine] decomposeSimpleLinearExpr should bail out on negative operands.

wael yehia via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 10:22:52 PDT 2022


w2yehia added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/neg-alloca.ll:1
+; RUN: opt -S -passes=instcombine < %s | FileCheck %s
+ at test = external global [1 x i32], align 16
----------------
nikic wrote:
> w2yehia wrote:
> > w2yehia wrote:
> > > nikic wrote:
> > > > Please use the llvm/utils/update_test_checks.py script to generate CHECK lines.
> > > > 
> > > > Also, I think that this test case may be reduced, I don't think you really need much more than then mul+add+alloca+bitcast sequence?
> > > I reduced the testcase, and made the RUN command canonical (based on suggestions in update_test_checks.py).
> > > I think the current CHECKs capture the required functionality best.
> > > I think the current CHECKs capture the required functionality best.
> > Sorry wrote in a rush. I mean that we want the test not to be fragile (that's obvious) and so having too much CHECKs is not good. I think it's enough to CHECK that the negative operand remains and the alloca type is the same.
> We generally prefer to always use auto-generated check lines, even if they contain "unnecessary" instructions, because it makes it easier to update tests in the future.
fair enough. Thanks.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126546/new/

https://reviews.llvm.org/D126546



More information about the llvm-commits mailing list