diff options
| author | Bill Wendling <isanbard@gmail.com> | 2008-05-28 22:52:47 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2008-05-28 22:52:47 +0000 |
| commit | 5a83b097ed1d217e127cd68e75749addabdb141d (patch) | |
| tree | fa4041eba70dd5b1a49942ca7686c364f97c5851 | |
| parent | 779b4180dce506d28b01fac72f55884d1abe85e0 (diff) | |
| download | bcm5719-llvm-5a83b097ed1d217e127cd68e75749addabdb141d.tar.gz bcm5719-llvm-5a83b097ed1d217e127cd68e75749addabdb141d.zip | |
Check the "isSafeToMove" predicate, which has a series of tests to make sure
that it's safe to remat an instruction.
llvm-svn: 51659
| -rw-r--r-- | llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp index 145f80ae74b..5f0a923f996 100644 --- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -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 { |

