aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/TwoAddressInstructionPass.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-08-27 20:58:54 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-08-27 20:58:54 +0000
commita02c669b712be61831109eabf521e937d577faca (patch)
tree976c100a2feb2395b6f7e5c5b0a83ad00b509cad /lib/CodeGen/TwoAddressInstructionPass.cpp
parent704c525ba7e74a75c54d23509c9db3f1a8f91fc7 (diff)
downloadexternal_llvm-a02c669b712be61831109eabf521e937d577faca.tar.gz
external_llvm-a02c669b712be61831109eabf521e937d577faca.tar.bz2
external_llvm-a02c669b712be61831109eabf521e937d577faca.zip
Move the check whether it's worth remating to caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55434 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r--lib/CodeGen/TwoAddressInstructionPass.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp
index 5093321c6a..51a3c5f52e 100644
--- a/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -403,6 +403,7 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &MF) {
// If it's safe and profitable, remat the definition instead of
// copying it.
if (DefMI &&
+ DefMI->getDesc().isAsCheapAsAMove() &&
DefMI->isSafeToReMat(TII, regB) &&
isProfitableToReMat(regB, rc, mi, DefMI, mbbi, Dist,DistanceMap)){
DEBUG(cerr << "2addr: REMATTING : " << *DefMI << "\n");