mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-05 12:31:33 +00:00
Check the "isSafeToMove" predicate, which has a series of tests to make sure
that it's safe to remat an instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51659 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
745825f431
commit
a8db14796b
@ -330,8 +330,10 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
|
||||
InstructionRearranged:
|
||||
const TargetRegisterClass* rc = MF.getRegInfo().getRegClass(regA);
|
||||
MachineInstr *Orig = MRI->getVRegDef(regB);
|
||||
bool SawStore = false;
|
||||
|
||||
if (EnableReMat && Orig && TII->isTriviallyReMaterializable(Orig)) {
|
||||
if (EnableReMat && Orig && Orig->isSafeToMove(TII, SawStore) &&
|
||||
TII->isTriviallyReMaterializable(Orig)) {
|
||||
TII->reMaterialize(*mbbi, mi, regA, Orig);
|
||||
ReMattedInstrs.insert(Orig);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user