[llvm-commits] [llvm] r144044 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp test/CodeGen/X86/2011-11-07-LegalizeBuildVector.ll

Eli Friedman eli.friedman at gmail.com
Mon Nov 7 15:53:20 PST 2011


Author: efriedma
Date: Mon Nov  7 17:53:20 2011
New Revision: 144044

URL: http://llvm.org/viewvc/llvm-project?rev=144044&view=rev
Log:
Revert r144034 while I try to track down a crash.


Removed:
    llvm/trunk/test/CodeGen/X86/2011-11-07-LegalizeBuildVector.ll
Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=144044&r1=144043&r2=144044&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Mon Nov  7 17:53:20 2011
@@ -285,7 +285,6 @@
       Result = DAG.getStore(Chain, dl, Result, Ptr, ST->getPointerInfo(),
                            ST->isVolatile(), ST->isNonTemporal(), Alignment);
       DAG.ReplaceAllUsesWith(SDValue(ST, 0), Result, DUL);
-      DAG.RemoveDeadNode(ST, DUL);
       return;
     }
     // Do a (aligned) store to a stack slot, then copy from the stack slot
@@ -350,7 +349,6 @@
       DAG.getNode(ISD::TokenFactor, dl, MVT::Other, &Stores[0],
                   Stores.size());
     DAG.ReplaceAllUsesWith(SDValue(ST, 0), Result, DUL);
-    DAG.RemoveDeadNode(ST, DUL);
     return;
   }
   assert(ST->getMemoryVT().isInteger() &&
@@ -383,7 +381,6 @@
   SDValue Result =
     DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Store1, Store2);
   DAG.ReplaceAllUsesWith(SDValue(ST, 0), Result, DUL);
-  DAG.RemoveDeadNode(ST, DUL);
 }
 
 /// ExpandUnalignedLoad - Expands an unaligned load to 2 half-size loads.
@@ -1147,7 +1144,6 @@
     if (!ST->isTruncatingStore()) {
       if (SDNode *OptStore = OptimizeFloatStore(ST).getNode()) {
         DAG.ReplaceAllUsesWith(ST, OptStore, this);
-        DAG.RemoveDeadNode(ST, this);
         break;
       }
 
@@ -1173,10 +1169,8 @@
           break;
         case TargetLowering::Custom:
           Tmp1 = TLI.LowerOperation(SDValue(Node, 0), DAG);
-          if (Tmp1.getNode()) {
+          if (Tmp1.getNode())
             DAG.ReplaceAllUsesWith(SDValue(Node, 0), Tmp1, this);
-            DAG.RemoveDeadNode(Node, this);
-          }
           break;
         case TargetLowering::Promote: {
           assert(VT.isVector() && "Unknown legal promote case!");
@@ -1187,7 +1181,6 @@
                          ST->getPointerInfo(), isVolatile,
                          isNonTemporal, Alignment);
           DAG.ReplaceAllUsesWith(SDValue(Node, 0), Result, this);
-          DAG.RemoveDeadNode(Node, this);
           break;
         }
         }
@@ -1210,7 +1203,6 @@
           DAG.getTruncStore(Tmp1, dl, Tmp3, Tmp2, ST->getPointerInfo(),
                             NVT, isVolatile, isNonTemporal, Alignment);
         DAG.ReplaceAllUsesWith(SDValue(Node, 0), Result, this);
-        DAG.RemoveDeadNode(Node, this);
       } else if (StWidth & (StWidth - 1)) {
         // If not storing a power-of-2 number of bits, expand as two stores.
         assert(!StVT.isVector() && "Unsupported truncstore!");
@@ -1266,7 +1258,6 @@
         // The order of the stores doesn't matter.
         SDValue Result = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Lo, Hi);
         DAG.ReplaceAllUsesWith(SDValue(Node, 0), Result, this);
-        DAG.RemoveDeadNode(Node, this);
       } else {
         if (Tmp1 != ST->getChain() || Tmp3 != ST->getValue() ||
             Tmp2 != ST->getBasePtr())
@@ -1289,7 +1280,6 @@
           DAG.ReplaceAllUsesWith(SDValue(Node, 0),
                                  TLI.LowerOperation(SDValue(Node, 0), DAG),
                                  this);
-          DAG.RemoveDeadNode(Node, this);
           break;
         case TargetLowering::Expand:
           assert(!StVT.isVector() &&
@@ -1302,7 +1292,6 @@
             DAG.getStore(Tmp1, dl, Tmp3, Tmp2, ST->getPointerInfo(),
                          isVolatile, isNonTemporal, Alignment);
           DAG.ReplaceAllUsesWith(SDValue(Node, 0), Result, this);
-          DAG.RemoveDeadNode(Node, this);
           break;
         }
       }
@@ -3372,7 +3361,6 @@
       DAG.getNode(ISD::BUILD_VECTOR, dl, Node->getValueType(0),
                   &Scalars[0], Scalars.size());
     DAG.ReplaceAllUsesWith(SDValue(Node, 0), Result, this);
-    DAG.RemoveDeadNode(Node, this);
     break;
   }
   case ISD::GLOBAL_OFFSET_TABLE:
@@ -3389,10 +3377,8 @@
   }
 
   // Replace the original node with the legalized result.
-  if (!Results.empty()) {
+  if (!Results.empty())
     DAG.ReplaceAllUsesWith(Node, Results.data(), this);
-    DAG.RemoveDeadNode(Node, this);
-  }
 }
 
 void SelectionDAGLegalize::PromoteNode(SDNode *Node) {
@@ -3526,10 +3512,8 @@
   }
 
   // Replace the original node with the legalized result.
-  if (!Results.empty()) {
+  if (!Results.empty())
     DAG.ReplaceAllUsesWith(Node, Results.data(), this);
-    DAG.RemoveDeadNode(Node, this);
-  }
 }
 
 // SelectionDAG::Legalize - This is the entry point for the file.

Removed: llvm/trunk/test/CodeGen/X86/2011-11-07-LegalizeBuildVector.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2011-11-07-LegalizeBuildVector.ll?rev=144043&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2011-11-07-LegalizeBuildVector.ll (original)
+++ llvm/trunk/test/CodeGen/X86/2011-11-07-LegalizeBuildVector.ll (removed)
@@ -1,14 +0,0 @@
-; RUN: llc < %s -march=x86 -mattr=+avx | FileCheck %s
-
-; We don't really care what this outputs; just make sure it's somewhat sane.
-; CHECK: legalize_test
-; CHECK: vmovups
-define void @legalize_test(i32 %x, <8 x i32>* %p) nounwind {
-entry:
-  %t1 = insertelement <8 x i32> <i32 undef, i32 undef, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>, i32 %x, i32 0
-  %t2 = shufflevector <8 x i32> %t1, <8 x i32> zeroinitializer, <8 x i32> <i32 0, i32 9, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
-  %int2float = sitofp <8 x i32> %t2 to <8 x float>
-  %blendAsInt.i821 = bitcast <8 x float> %int2float to <8 x i32>
-  store <8 x i32> %blendAsInt.i821, <8 x i32>* %p, align 4
-  ret void
-}





More information about the llvm-commits mailing list