summaryrefslogtreecommitdiffstats
path: root/clang/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
commitdb3e5e2408c756bbf869ffc03168ae93f0dbb880 (patch)
tree81d83d56af30f59ea52cd9507d5336b914a1a88c /clang/utils
parentcd8535a96dec3e68b626240cc85cc34168fe5c7c (diff)
downloadbcm5719-llvm-db3e5e2408c756bbf869ffc03168ae93f0dbb880.tar.gz
bcm5719-llvm-db3e5e2408c756bbf869ffc03168ae93f0dbb880.zip
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"). llvm-svn: 201667
Diffstat (limited to 'clang/utils')
-rw-r--r--clang/utils/TableGen/NeonEmitter.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/clang/utils/TableGen/NeonEmitter.cpp b/clang/utils/TableGen/NeonEmitter.cpp
index 9c863b21231..c17f7a5b51a 100644
--- a/clang/utils/TableGen/NeonEmitter.cpp
+++ b/clang/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";
}
OpenPOWER on IntegriCloud