[PATCH] D106918: [x86] improve CMOV codegen by pushing add into operands, part 3

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 28 04:25:55 PDT 2021


spatel added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:49972
+  if (OtherOp.getOpcode() == ISD::ADD && OtherOp.hasOneUse() &&
+      !isa<ConstantSDNode>(OtherOp.getOperand(0)) &&
+      all_of(N->uses(), [&](SDNode *Use) {
----------------
RKSimon wrote:
> We usually canonicalize add constants to RHS - does this actually cause problems?
I haven't been able to come up with a test to show this pattern, but I was worried that we could get in here in some intermediate non-canonical state. 

If that happens, we'd likely hit an infinite loop with the previous transform, so I figured it was better to play it safe and check for constant.


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

https://reviews.llvm.org/D106918



More information about the llvm-commits mailing list