[llvm-commits] CVS: llvm/utils/TableGen/IntrinsicEmitter.cpp
Chris Lattner
sabre at nondot.org
Thu Feb 15 11:17:36 PST 2007
Changes in directory llvm/utils/TableGen:
IntrinsicEmitter.cpp updated: 1.27 -> 1.28
---
Log message:
Implement Function::getIntrinsicID without it needing to call Value::getName,
which allocates a string. This speeds up instcombine on 447.dealII by 5%.
---
Diffs of the changes: (+4 -2)
IntrinsicEmitter.cpp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
Index: llvm/utils/TableGen/IntrinsicEmitter.cpp
diff -u llvm/utils/TableGen/IntrinsicEmitter.cpp:1.27 llvm/utils/TableGen/IntrinsicEmitter.cpp:1.28
--- llvm/utils/TableGen/IntrinsicEmitter.cpp:1.27 Wed Feb 14 21:39:18 2007
+++ llvm/utils/TableGen/IntrinsicEmitter.cpp Thu Feb 15 13:17:16 2007
@@ -81,17 +81,19 @@
OS << "// Function name -> enum value recognizer code.\n";
OS << "#ifdef GET_FUNCTION_RECOGNIZER\n";
OS << " switch (Name[5]) {\n";
- OS << " default: break;\n";
+ OS << " default:\n";
// Emit the intrinsics in sorted order.
char LastChar = 0;
for (std::map<std::string, std::string>::iterator I = IntMapping.begin(),
E = IntMapping.end(); I != E; ++I) {
if (I->first[5] != LastChar) {
LastChar = I->first[5];
+ OS << " break;\n";
OS << " case '" << LastChar << "':\n";
}
- OS << " if (Name == \"" << I->first << "\") return Intrinsic::"
+ OS << " if (Len == " << I->first.size()
+ << " && !strcmp(Name, \"" << I->first << "\")) return Intrinsic::"
<< I->second << ";\n";
}
OS << " }\n";
More information about the llvm-commits
mailing list