diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-06-17 16:24:42 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-06-17 16:24:42 -0700 |
commit | 139165f35e841945b94685bdd91243f5b14d0a7a (patch) | |
tree | a3ebc050a54bee854a0e8170bc2abc8fc3511873 /lib/Target/ARM | |
parent | b1f3b6883c3b106c76088ae4d09e31c765a7667a (diff) |
PNaCl: Turn on ABI verifier by default in sandboxed translator
Change pnacl-llc.cpp to enable the verifier. This causes two problems
which we fix:
* The ABI check for declared-but-not-defined functions fails in
streaming mode. Fixing this would involve changing the bitcode
reader. For now, disable this check when in streaming mode. Add a
flag to PNaClABIVerifyModule.
* ARM's GlobalMerge pass modifies functions' global variable
references to use ConstantExprs that the ABI checker rejects.
Address this by disabling GlobalMerge for now.
GlobalMerge does not provide much benefit at the moment anyway,
because, with the FlattenGlobals pass applied, GlobalMerge doesn't
merge variables with alignment >1.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3465
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17190002
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r-- | lib/Target/ARM/ARMTargetMachine.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp index 499f974b96..23a2b3ad99 100644 --- a/lib/Target/ARM/ARMTargetMachine.cpp +++ b/lib/Target/ARM/ARMTargetMachine.cpp @@ -155,8 +155,18 @@ TargetPassConfig *ARMBaseTargetMachine::createPassConfig(PassManagerBase &PM) { } bool ARMPassConfig::addPreISel() { - if (TM->getOptLevel() != CodeGenOpt::None && EnableGlobalMerge) + // @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 (TM->getOptLevel() != CodeGenOpt::None && EnableGlobalMerge && + !getARMSubtarget().isTargetNaCl()) addPass(createGlobalMergePass(TM->getTargetLowering())); + // @LOCALMOD-END return false; } |