summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2005-12-12 23:22:48 +0000
committerEvan Cheng <evan.cheng@apple.com>2005-12-12 23:22:48 +0000
commit7e4c01eee36eb41a60fe7f48ec19a3a54dd3f224 (patch)
tree120ad5deba47fc1ebb7d14ec6c068913627f2148 /llvm/utils
parent9e8b633ec1ef948b7e3d05f4b665251a274c029d (diff)
downloadbcm5719-llvm-7e4c01eee36eb41a60fe7f48ec19a3a54dd3f224.tar.gz
bcm5719-llvm-7e4c01eee36eb41a60fe7f48ec19a3a54dd3f224.zip
At top of generated isel SelectCode() is this:
if (!N.Val->hasOneUse()) { std::map<SDOperand, SDOperand>::iterator CGMI = CodeGenMap.find(N); if (CGMI != CodeGenMap.end()) return CGMI->second; } Suppose a DAG like this: X ^ ^ / \ USE1 USE2 Suppose USE1 is being selected first and during which X is selected and returned a new node. After this, USE1 is no longer an use of X. During USE2 selection, X will be selected again since it has only one use! The fix is to always query CodeGenMap. llvm-svn: 24679
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/DAGISelEmitter.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp
index bcb28a628e6..0a8b989b37c 100644
--- a/llvm/utils/TableGen/DAGISelEmitter.cpp
+++ b/llvm/utils/TableGen/DAGISelEmitter.cpp
@@ -2234,10 +2234,8 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
<< " N.getOpcode() < (ISD::BUILTIN_OP_END+" << InstNS
<< "INSTRUCTION_LIST_END))\n"
<< " return N; // Already selected.\n\n"
- << " if (!N.Val->hasOneUse()) {\n"
- << " std::map<SDOperand, SDOperand>::iterator CGMI = CodeGenMap.find(N);\n"
- << " if (CGMI != CodeGenMap.end()) return CGMI->second;\n"
- << " }\n"
+ << " std::map<SDOperand, SDOperand>::iterator CGMI = CodeGenMap.find(N);\n"
+ << " if (CGMI != CodeGenMap.end()) return CGMI->second;\n"
<< " switch (N.getOpcode()) {\n"
<< " default: break;\n"
<< " case ISD::EntryToken: // These leaves remain the same.\n"
OpenPOWER on IntegriCloud