[PATCH] D116804: [x86] use SETCC_CARRY instead of SBB node for select lowering

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 7 05:28:04 PST 2022


spatel created this revision.
spatel added reviewers: craig.topper, pengfei, RKSimon, lebedev.ri.
Herald added subscribers: hiraditya, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is a suggested follow-up to D116765 <https://reviews.llvm.org/D116765> (and diffs are on top of that patch). This removes a clear of the register operand, so it is better for code size, but it does potentially create a false register dependency on surrounding code.

The asm results match what I was expecting, but I'm not exactly sure how this works. Given that the node is called SETCC_CARRY and documented as:

  // Same as SETCC except it's materialized with a sbb and the value is all
  // one's or all zero's.
  SETCC_CARRY, // R = carry_bit ? ~0 : 0

...why does it require a parameter for X86::COND_B? I changed that parameter in an experimental patch, and it didn't alter the asm.


https://reviews.llvm.org/D116804

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/pr35972.ll
  llvm/test/CodeGen/X86/sdiv_fix_sat.ll
  llvm/test/CodeGen/X86/select.ll
  llvm/test/CodeGen/X86/shl-crash-on-legalize.ll
  llvm/test/CodeGen/X86/umul_fix_sat.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116804.398110.patch
Type: text/x-patch
Size: 14630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220107/a9175275/attachment.bin>


More information about the llvm-commits mailing list