[X86] Don't check for folding into a store when deciding if we can promote an i16...
authorCraig Topper <craig.topper@intel.com>
Sun, 1 Apr 2018 06:29:32 +0000 (06:29 +0000)
committerCraig Topper <craig.topper@intel.com>
Sun, 1 Apr 2018 06:29:32 +0000 (06:29 +0000)
There's no RMW mul operation.

llvm-svn: 328931

llvm/lib/Target/X86/X86ISelLowering.cpp

index 85366ee..a87623a 100644 (file)
@@ -38755,10 +38755,12 @@ bool X86TargetLowering::IsDesirableToPromoteOp(SDValue Op, EVT &PVT) const {
     SDValue N1 = Op.getOperand(1);
     // Avoid disabling potential load folding opportunities.
     if (MayFoldLoad(N1) &&
-        (!Commute || !isa<ConstantSDNode>(N0) || IsFoldableRMW(N1, Op)))
+        (!Commute || !isa<ConstantSDNode>(N0) ||
+         (Op.getOpcode() != ISD::MUL && IsFoldableRMW(N1, Op))))
       return false;
     if (MayFoldLoad(N0) &&
-        ((Commute && !isa<ConstantSDNode>(N1)) || IsFoldableRMW(N0, Op)))
+        ((Commute && !isa<ConstantSDNode>(N1)) ||
+         (Op.getOpcode() != ISD::MUL && IsFoldableRMW(N0, Op))))
       return false;
   }
   }