summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PeepholeOptimizer.cpp
diff options
context:
space:
mode:
authorMichael Kuperstein <michael.m.kuperstein@intel.com>2015-08-11 08:19:43 +0000
committerMichael Kuperstein <michael.m.kuperstein@intel.com>2015-08-11 08:19:43 +0000
commit82814f63c035de29b37485d14749f4ddfb7d10d5 (patch)
treeb98ec3c7ee4c332c889cff207e3209aecda397a7 /llvm/lib/CodeGen/PeepholeOptimizer.cpp
parentc186ac7aeab6ae2f37f365bea99a02d49074c26f (diff)
downloadbcm5719-llvm-82814f63c035de29b37485d14749f4ddfb7d10d5.tar.gz
bcm5719-llvm-82814f63c035de29b37485d14749f4ddfb7d10d5.zip
Allow PeepholeOptimizer to fold a few more cases
The condition for clearing the folding candidate list was clamped together with the "uninteresting instruction" condition. This is too conservative, e.g. we don't need to clear the list when encountering an IMPLICIT_DEF. Differential Revision: http://reviews.llvm.org/D11591 llvm-svn: 244577
Diffstat (limited to 'llvm/lib/CodeGen/PeepholeOptimizer.cpp')
-rw-r--r--llvm/lib/CodeGen/PeepholeOptimizer.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/PeepholeOptimizer.cpp b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
index 21d603b19ef..3dc73bac5b8 100644
--- a/llvm/lib/CodeGen/PeepholeOptimizer.cpp
+++ b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
@@ -1236,14 +1236,13 @@ bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
// If there exists an instruction which belongs to the following
// categories, we will discard the load candidates.
+ if (MI->mayStore() || MI->isCall() || MI->hasUnmodeledSideEffects())
+ FoldAsLoadDefCandidates.clear();
+
if (MI->isPosition() || MI->isPHI() || MI->isImplicitDef() ||
MI->isKill() || MI->isInlineAsm() ||
- MI->hasUnmodeledSideEffects()) {
- FoldAsLoadDefCandidates.clear();
+ MI->hasUnmodeledSideEffects())
continue;
- }
- if (MI->mayStore() || MI->isCall())
- FoldAsLoadDefCandidates.clear();
if ((isUncoalescableCopy(*MI) &&
optimizeUncoalescableCopy(MI, LocalMIs)) ||
OpenPOWER on IntegriCloud