Allow the third argument for the subi family to be an expression.
[oota-llvm.git] / lib / Target / X86 / X86ISelLowering.cpp
index d85ac5e55e43389aa694247e9bce8a229873163a..782ba5f7a78a8a3dbbb2b64397d367bf45a4cbc8 100644 (file)
@@ -2062,8 +2062,8 @@ bool X86TargetLowering::isUsedByReturnOnly(SDNode *N, SDValue &Chain) const {
   return true;
 }
 
-MVT
-X86TargetLowering::getTypeForExtArgOrReturn(MVT VT,
+EVT
+X86TargetLowering::getTypeForExtArgOrReturn(LLVMContext &Context, EVT VT,
                                             ISD::NodeType ExtendKind) const {
   MVT ReturnMVT;
   // TODO: Is this also valid on 32-bit?
@@ -2072,7 +2072,7 @@ X86TargetLowering::getTypeForExtArgOrReturn(MVT VT,
   else
     ReturnMVT = MVT::i32;
 
-  MVT MinVT = getRegisterType(ReturnMVT);
+  EVT MinVT = getRegisterType(Context, ReturnMVT);
   return VT.bitsLT(MinVT) ? MinVT : VT;
 }
 
@@ -7546,10 +7546,10 @@ static SDValue lowerV8I16SingleInputVectorShuffle(
           // We also have to update the final source mask in this case because
           // it may need to undo the above swap.
           for (int &M : FinalSourceHalfMask)
-            if (M == (InputsFixed[0] ^ 1))
-              M = InputsFixed[1];
-            else if (M == InputsFixed[1])
-              M = InputsFixed[0] ^ 1;
+            if (M == (InputsFixed[0] ^ 1) + SourceOffset)
+              M = InputsFixed[1] + SourceOffset;
+            else if (M == InputsFixed[1] + SourceOffset)
+              M = (InputsFixed[0] ^ 1) + SourceOffset;
 
           InputsFixed[1] = InputsFixed[0] ^ 1;
         }