summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2017-12-05 00:56:14 +0000
committerMatthias Braun <matze@braunis.de>2017-12-05 00:56:14 +0000
commit62378bb5ab6f5c1e965e4a863f3d541772efe3c4 (patch)
tree23c938b35245b51118a132d9d6dad408b97fa489 /llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
parent5a34c34858020b6eb0fc6d5ba9c80f582d032c92 (diff)
downloadbcm5719-llvm-62378bb5ab6f5c1e965e4a863f3d541772efe3c4.tar.gz
bcm5719-llvm-62378bb5ab6f5c1e965e4a863f3d541772efe3c4.zip
TwoAddressInstructionPass: Trigger -O0 behavior on optnone
While we cannot skip the whole TwoAddressInstructionPass even for -O0 there are some parts of the pass that are currently skipped at -O0 but not for optnone. Changing this as there is no reason to have those two hit different code paths here. llvm-svn: 319721
Diffstat (limited to 'llvm/lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r--llvm/lib/CodeGen/TwoAddressInstructionPass.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index 28a4375cb28..c51340766b7 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -1661,6 +1661,10 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &Func) {
else
AA = nullptr;
OptLevel = TM.getOptLevel();
+ // Disable optimizations if requested. We cannot skip the whole pass as some
+ // fixups are necessary for correctness.
+ if (skipFunction(*Func.getFunction()))
+ OptLevel = CodeGenOpt::None;
bool MadeChange = false;
OpenPOWER on IntegriCloud