[X86] Allow x86 call frame optimization to fold more loads into pushes

This abstracts away the test for "when can we fold across a MachineInstruction"
into the the MI interface, and changes call-frame optimization use the same test
the peephole optimizer users.

Differential Revision: http://reviews.llvm.org/D11945

llvm-svn: 244729
This commit is contained in:
Michael Kuperstein
2015-08-12 10:14:58 +00:00
parent c574686529
commit bc7f99a3ab
5 changed files with 36 additions and 9 deletions

View File

@@ -1503,6 +1503,10 @@ bool MachineInstr::hasUnmodeledSideEffects() const {
return false;
}
bool MachineInstr::isLoadFoldBarrier() const {
return mayStore() || isCall() || hasUnmodeledSideEffects();
}
/// allDefsAreDead - Return true if all the defs of this instruction are dead.
///
bool MachineInstr::allDefsAreDead() const {