aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-09-26 22:10:24 +0000
committerChris Lattner <sabre@nondot.org>2005-09-26 22:10:24 +0000
commitfab372880199de4a71b8e3ce8a6b8a53c85baa60 (patch)
tree588a74d82b95c4005496e20f188f0519b56a243a /utils
parent3748147aaf73cba847ffad30a55de7e7df214b13 (diff)
downloadexternal_llvm-fab372880199de4a71b8e3ce8a6b8a53c85baa60.zip
external_llvm-fab372880199de4a71b8e3ce8a6b8a53c85baa60.tar.gz
external_llvm-fab372880199de4a71b8e3ce8a6b8a53c85baa60.tar.bz2
memoize the assert results
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/DAGISelEmitter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp
index bd43909..27c0dfa 100644
--- a/utils/TableGen/DAGISelEmitter.cpp
+++ b/utils/TableGen/DAGISelEmitter.cpp
@@ -1230,8 +1230,11 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
<< " case ISD::EntryToken: // These leaves remain the same.\n"
<< " return N;\n"
<< " case ISD::AssertSext:\n"
- << " case ISD::AssertZext:\n"
- << " return Select(N.getOperand(0));\n";
+ << " case ISD::AssertZext: {\n"
+ << " SDOperand Tmp0 = Select(N.getOperand(0));\n"
+ << " if (!N.Val->hasOneUse()) CodeGenMap[N] = Tmp0;\n"
+ << " return Tmp0;\n"
+ << " }\n";
// Group the patterns by their top-level opcodes.
std::map<Record*, std::vector<PatternToMatch*>,