[PATCH] D68408: [InstCombine] Negator - sink sinkable negations

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 11 06:55:29 PDT 2020


lebedev.ri updated this revision to Diff 256768.
lebedev.ri added a comment.

Rebased.

Finally understood the interfering transforms - this fundamentally interferes with D48754 <https://reviews.llvm.org/D48754>.
Yes, i see the PhaseOrdering regressions if we revert that.
Not yet sure how to deal with this, i see 3 options:

1. don't do such canonicalization (what i've done here)
2. don't implement Negator
3. add `Abs` IR instruction (i think not)
4. Don't try to sink negation when it's used by `abs`/`nabs` pattern

This doesn't hang `check-llvm`/test-suite.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68408

Files:
  llvm/lib/Transforms/InstCombine/CMakeLists.txt
  llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
  llvm/lib/Transforms/InstCombine/InstCombineInternal.h
  llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp
  llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Transforms/InstCombine/abs-1.ll
  llvm/test/Transforms/InstCombine/abs_abs.ll
  llvm/test/Transforms/InstCombine/and-or-icmps.ll
  llvm/test/Transforms/InstCombine/cttz-abs.ll
  llvm/test/Transforms/InstCombine/fold-sub-of-not-to-inc-of-add.ll
  llvm/test/Transforms/InstCombine/high-bit-signmask-with-trunc.ll
  llvm/test/Transforms/InstCombine/high-bit-signmask.ll
  llvm/test/Transforms/InstCombine/icmp.ll
  llvm/test/Transforms/InstCombine/max-of-nots.ll
  llvm/test/Transforms/InstCombine/select_meta.ll
  llvm/test/Transforms/InstCombine/sub-of-negatible.ll
  llvm/test/Transforms/InstCombine/sub.ll
  llvm/test/Transforms/InstCombine/zext-bool-add-sub.ll
  llvm/test/Transforms/PhaseOrdering/min-max-abs-cse.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68408.256768.patch
Type: text/x-patch
Size: 116742 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200411/4c872d76/attachment-0001.bin>


More information about the llvm-commits mailing list