Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: lib/Target/ARM/ARMTargetMachine.cpp

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Target/ARM/ARMSubtarget.cpp ('k') | lib/Target/ARM/ARMTargetObjectFile.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Target/ARM/ARMTargetMachine.cpp
diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp
index 88d6c5e7fb9024c6f49ca60a83b07f8b29598283..cd5e1a3786ead10a7e8df827dcd4ba21f09289d8 100644
--- a/lib/Target/ARM/ARMTargetMachine.cpp
+++ b/lib/Target/ARM/ARMTargetMachine.cpp
@@ -22,6 +22,9 @@
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Target/TargetOptions.h"
+// @LOCALMOD-START
+#include "llvm/Transforms/NaCl.h"
+// @LOCALMOD-END
#include "llvm/Transforms/Scalar.h"
using namespace llvm;
@@ -208,6 +211,11 @@ TargetPassConfig *ARMBaseTargetMachine::createPassConfig(PassManagerBase &PM) {
}
void ARMPassConfig::addIRPasses() {
+ // @LOCALMOD-START
+ if (getARMSubtarget().isTargetNaCl())
+ addPass(createInsertDivideCheckPass());
+ // @LOCALMOD-END
+
if (TM->Options.ThreadModel == ThreadModel::Single)
addPass(createLowerAtomicPass());
else
@@ -225,7 +233,17 @@ void ARMPassConfig::addIRPasses() {
}
bool ARMPassConfig::addPreISel() {
- if (TM->getOptLevel() != CodeGenOpt::None)
+ // @LOCALMOD-START
+ // We disable the GlobalMerge pass for PNaCl because it causes the
+ // PNaCl ABI checker to reject the program when the PNaCl translator
+ // is run in streaming mode. This is because GlobalMerge replaces
+ // functions' GlobalVariable references with ConstantExprs which the
+ // ABI verifier rejects.
+ // TODO(mseaborn): Make the ABI checks coexist with GlobalMerge to
+ // get back the performance benefits of GlobalMerge.
+ if (!getARMSubtarget().isTargetNaCl() &&
+ TM->getOptLevel() != CodeGenOpt::None)
+ // @LOCALMOD-END
addPass(createGlobalMergePass(TM));
return false;
@@ -293,7 +311,18 @@ bool ARMPassConfig::addPreEmitPass() {
}
addPass(createARMOptimizeBarriersPass());
- addPass(createARMConstantIslandPass());
+
+ // @LOCALMOD-START
+ if (getARMSubtarget().useConstIslands())
+ addPass(createARMConstantIslandPass());
+ // @LOCALMOD-END
+
+ // @LOCALMOD-START
+ // This pass does all the heavy sfi lifting.
+ if (getARMSubtarget().isTargetNaCl()) {
+ addPass(createARMNaClRewritePass());
+ }
+ // @LOCALMOD-END
return true;
}
« no previous file with comments | « lib/Target/ARM/ARMSubtarget.cpp ('k') | lib/Target/ARM/ARMTargetObjectFile.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698