summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-05-28 22:52:47 +0000
committerBill Wendling <isanbard@gmail.com>2008-05-28 22:52:47 +0000
commit5a83b097ed1d217e127cd68e75749addabdb141d (patch)
treefa4041eba70dd5b1a49942ca7686c364f97c5851
parent779b4180dce506d28b01fac72f55884d1abe85e0 (diff)
downloadbcm5719-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.cpp4
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 {
OpenPOWER on IntegriCloud