[PATCH] D63958: [SDAG] commute setcc operands to match a subtract

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 14:34:42 PDT 2019


spatel created this revision.
spatel added reviewers: craig.topper, RKSimon, efriedma, jpienaar.
Herald added subscribers: jsji, hiraditya, javed.absar, mcrosier.
Herald added a project: LLVM.

If we have:

  R = sub X, Y
  P = cmp Y, X

...then flipping the operands in the compare instruction can allow using a subtract that sets compare flags.

Motivated by diffs in D58875 <https://reviews.llvm.org/D58875> - not sure if this changes anything there, but this seems like a good thing independent of that.

I've never seen Lanai code before this, so I don't know whether that change is good, bad, or even correct.


https://reviews.llvm.org/D63958

Files:
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/test/CodeGen/AArch64/arm64-shrink-wrapping.ll
  llvm/test/CodeGen/AArch64/cgp-usubo.ll
  llvm/test/CodeGen/Lanai/sub-cmp-peephole.ll
  llvm/test/CodeGen/X86/jump_sign.ll
  llvm/test/CodeGen/X86/psubus.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63958.207144.patch
Type: text/x-patch
Size: 13186 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190628/73aef6ae/attachment.bin>


More information about the llvm-commits mailing list