]> granicus.if.org Git - llvm/commitdiff
[X86] Add an early out to combineLoopMAddPattern and combineLoopSADPattern when SSE2...
authorCraig Topper <craig.topper@intel.com>
Mon, 28 Aug 2017 04:29:08 +0000 (04:29 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 28 Aug 2017 04:29:08 +0000 (04:29 +0000)
Without this the madd.ll and sad.ll test cases both throw assertions if you run them with SSE2 disabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311872 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index ecc8ff0b1af97242fc48983a592c8c56944730ca..c9afea2d1631d04261e4a7aa22987768a9bf31e0 100644 (file)
@@ -35230,6 +35230,9 @@ static SDValue combineAddOrSubToADCOrSBB(SDNode *N, SelectionDAG &DAG) {
 
 static SDValue combineLoopMAddPattern(SDNode *N, SelectionDAG &DAG,
                                       const X86Subtarget &Subtarget) {
+  if (!Subtarget.hasSSE2())
+    return SDValue();
+
   SDValue MulOp = N->getOperand(0);
   SDValue Phi = N->getOperand(1);
 
@@ -35275,6 +35278,9 @@ static SDValue combineLoopMAddPattern(SDNode *N, SelectionDAG &DAG,
 
 static SDValue combineLoopSADPattern(SDNode *N, SelectionDAG &DAG,
                                      const X86Subtarget &Subtarget) {
+  if (!Subtarget.hasSSE2())
+    return SDValue();
+
   SDLoc DL(N);
   EVT VT = N->getValueType(0);
   SDValue Op0 = N->getOperand(0);