diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-06-29 21:36:04 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-06-29 21:36:04 +0000 |
| commit | 9458e6a551548ab143f1ba9466931de20c65d745 (patch) | |
| tree | c35ca0070eb7d269e1ad6c4d7f544b852e872640 /llvm/lib/CodeGen/SelectionDAG | |
| parent | 4c04a9333acd5c3a4c1c752f76964b21dfaf6925 (diff) | |
| download | bcm5719-llvm-9458e6a551548ab143f1ba9466931de20c65d745.tar.gz bcm5719-llvm-9458e6a551548ab143f1ba9466931de20c65d745.zip | |
Fix a vector FP constant CSE bug.
llvm-svn: 37814
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 6dcba0d9d6b..9eee1984af7 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -686,11 +686,16 @@ SDOperand SelectionDAG::getConstantFP(double Val, MVT::ValueType VT, 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; |

