[PATCH] D122482: [X86] combineADC - fold ADC(C1,C2,Carry) -> ADC(0,C1+C2,Carry)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 25 07:19:20 PDT 2022


RKSimon created this revision.
RKSimon added reviewers: craig.topper, pengfei, spatel, lebedev.ri.
Herald added subscribers: StephenFan, javed.absar, hiraditya.
Herald added a project: All.
RKSimon requested review of this revision.
Herald added a project: LLVM.

If we're not relying on the flag result, we can fold the constants together into the RHS immediate operand and set the LHS operand to zero, simplifying for further folds.

We could do something similar if the flag result is in use and the constant fold doesn't affect it, but I don't have any real test cases for this yet.

As suggested by @davezarzycki on Issue #35256


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122482

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/call-rv-marker.ll
  llvm/test/CodeGen/X86/combine-adc.ll
  llvm/test/CodeGen/X86/combine-add.ll
  llvm/test/CodeGen/X86/pr16031.ll
  llvm/test/CodeGen/X86/scheduler-backtracking.ll
  llvm/test/CodeGen/X86/setcc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122482.418216.patch
Type: text/x-patch
Size: 9134 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220325/62ed1689/attachment.bin>


More information about the llvm-commits mailing list