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

Evan Cheng evan.cheng at apple.com
Fri Jun 29 14:36:04 PDT 2007


Author: evancheng
Date: Fri Jun 29 16:36:04 2007
New Revision: 37814

URL: http://llvm.org/viewvc/llvm-project?rev=37814&view=rev
Log:
Fix a vector FP constant CSE bug.

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=37814&r1=37813&r2=37814&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Fri Jun 29 16:36:04 2007
@@ -686,11 +686,16 @@
   AddNodeIDNode(ID, Opc, getVTList(EltVT), 0, 0);
   ID.AddDouble(Val);
   void *IP = 0;
-  if (SDNode *E = CSEMap.FindNodeOrInsertPos(ID, IP))
-    return SDOperand(E, 0);
-  SDNode *N = new ConstantFPSDNode(isTarget, Val, EltVT);
-  CSEMap.InsertNode(N, IP);
-  AllNodes.push_back(N);
+  SDNode *N = NULL;
+  if ((N = CSEMap.FindNodeOrInsertPos(ID, IP)))
+    if (!MVT::isVector(VT))
+      return SDOperand(N, 0);
+  if (!N) {
+    N = new ConstantFPSDNode(isTarget, Val, EltVT);
+    CSEMap.InsertNode(N, IP);
+    AllNodes.push_back(N);
+  }
+
   SDOperand Result(N, 0);
   if (MVT::isVector(VT)) {
     SmallVector<SDOperand, 8> Ops;





More information about the llvm-commits mailing list