[llvm-commits] [llvm] r43498 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Duncan Sands baldrick at free.fr
Tue Oct 30 05:40:59 PDT 2007


Author: baldrick
Date: Tue Oct 30 07:40:58 2007
New Revision: 43498

URL: http://llvm.org/viewvc/llvm-project?rev=43498&view=rev
Log:
If a call to getTruncStore is for a normal store,
offload to getStore rather than trying to handle
both cases at once (the assertions for example
assume the store really is truncating).

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=43498&r1=43497&r2=43498&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Oct 30 07:40:58 2007
@@ -2460,7 +2460,9 @@
                                       int SVOffset, MVT::ValueType SVT,
                                       bool isVolatile, unsigned Alignment) {
   MVT::ValueType VT = Val.getValueType();
-  bool isTrunc = VT != SVT;
+
+  if (VT == SVT)
+    return getStore(Chain, Val, Ptr, SV, SVOffset, isVolatile, Alignment);
 
   assert(MVT::getSizeInBits(VT) > MVT::getSizeInBits(SVT) &&
          "Not a truncation?");
@@ -2485,7 +2487,7 @@
   FoldingSetNodeID ID;
   AddNodeIDNode(ID, ISD::STORE, VTs, Ops, 4);
   ID.AddInteger(ISD::UNINDEXED);
-  ID.AddInteger(isTrunc);
+  ID.AddInteger(1);
   ID.AddInteger((unsigned int)SVT);
   ID.AddPointer(SV);
   ID.AddInteger(SVOffset);
@@ -2494,7 +2496,7 @@
   void *IP = 0;
   if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
     return SDOperand(E, 0);
-  SDNode *N = new StoreSDNode(Ops, VTs, ISD::UNINDEXED, isTrunc,
+  SDNode *N = new StoreSDNode(Ops, VTs, ISD::UNINDEXED, true,
                               SVT, SV, SVOffset, Alignment, isVolatile);
   CSEMap.InsertNode(N, IP);
   AllNodes.push_back(N);





More information about the llvm-commits mailing list