summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-02-19 11:55:06 +0000
committerTim Northover <tnorthover@apple.com>2014-02-19 11:55:06 +0000
commit7d2228a72e2275c3a8cf2fc7d2b04bfad2955788 (patch)
tree7aae064729258bb955bfc2684301cc8fadf886db /utils
parent7e4849356354e48bb034f4867990d954df695b72 (diff)
downloadclang-7d2228a72e2275c3a8cf2fc7d2b04bfad2955788.tar.gz
clang-7d2228a72e2275c3a8cf2fc7d2b04bfad2955788.tar.bz2
clang-7d2228a72e2275c3a8cf2fc7d2b04bfad2955788.tar.xz
AArch64: look up EmitAArch64Scalar support before calling.
This fixes one immediate bug where an expression with side-effects could be emitted twice during a NEON call. It also prepares the way for folding CodeGen for many of the SISD intrinsics into a table, reducing code size and hopefully increasing performance eventually ("binary search + few switch cases" should be better than "lots of switch cases"). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201667 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/NeonEmitter.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/utils/TableGen/NeonEmitter.cpp b/utils/TableGen/NeonEmitter.cpp
index 9c863b2123..c17f7a5b51 100644
--- a/utils/TableGen/NeonEmitter.cpp
+++ b/utils/TableGen/NeonEmitter.cpp
@@ -3165,10 +3165,10 @@ NeonEmitter::genOverloadTypeCheckCode(raw_ostream &OS) {
/// declaration of builtins, checking for unique builtin declarations.
void NeonEmitter::genBuiltinsDef(raw_ostream &OS) {
std::vector<Record *> RV = Records.getAllDerivedDefinitions("Inst");
- StringMap<OpKind> EmittedMap;
- // Generate BuiltinsNEON.
- OS << "#ifdef GET_NEON_BUILTINS\n";
+ // We want to emit the intrinsics in alphabetical order, so use the more
+ // expensive std::map to gather them together first.
+ std::map<std::string, OpKind> EmittedMap;
for (unsigned i = 0, e = RV.size(); i != e; ++i) {
Record *R = RV[i];
@@ -3203,9 +3203,17 @@ void NeonEmitter::genBuiltinsDef(raw_ostream &OS) {
continue;
EmittedMap[bd] = OpNone;
- OS << bd << "\n";
}
}
+
+ // Generate BuiltinsNEON.
+ OS << "#ifdef GET_NEON_BUILTINS\n";
+
+ for (std::map<std::string, OpKind>::iterator I = EmittedMap.begin(),
+ E = EmittedMap.end();
+ I != E; ++I)
+ OS << I->first << "\n";
+
OS << "#endif\n\n";
}