[PATCH] D83153: [DAGCombiner] Prevent regression in isMulAddWithConstProfitable

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 11 08:56:04 PDT 2020


benshi001 added a comment.

Change list according to all your comments.

1. Seperate the test cases to show improvement in another patch.

Done. https://reviews.llvm.org/D83159, which has been landed.

2. Make sure c1 and c2 do not exceed int64, to avoid assert failure.

Done. One more if-statment is added to check that.

3. Check if c1*c2 is overflow.

If we stop the transform when c1*c2 overflows, the x86 will be impacked a lot,
I am afraid introducing more regression.

4. Make a inverse transform if "opt -instcombine" has been performed.

Shall we seperate this inverse transform in another patch? At least this patch improves
the test case urem-seteq-nonzero.ll, and the case llvm/test/CodeGen/RISCV/addimm-mulimm.ll

5. Some other small fixes.


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

https://reviews.llvm.org/D83153





More information about the llvm-commits mailing list