[llvm] r311872 - [X86] Add an early out to combineLoopMAddPattern and combineLoopSADPattern when SSE2 is disabled.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 27 21:29:08 PDT 2017


Author: ctopper
Date: Sun Aug 27 21:29:08 2017
New Revision: 311872

URL: http://llvm.org/viewvc/llvm-project?rev=311872&view=rev
Log:
[X86] Add an early out to combineLoopMAddPattern and combineLoopSADPattern when SSE2 is disabled.

Without this the madd.ll and sad.ll test cases both throw assertions if you run them with SSE2 disabled.

Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=311872&r1=311871&r2=311872&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sun Aug 27 21:29:08 2017
@@ -35230,6 +35230,9 @@ static SDValue combineAddOrSubToADCOrSBB
 
 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(SD
 
 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);




More information about the llvm-commits mailing list