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
This commit is contained in:
@@ -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)) ||
|
||||
|
||||
Reference in New Issue
Block a user