aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-02-04 09:21:58 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-02-04 09:21:58 +0000
commit5caa883afc2c768c293757d4ca30d85b9094e876 (patch)
tree2450fe71a11290677baa518a53f069a5ddc7d8c7
parent45e94d68d7c99235cf4decc72812445b214df40e (diff)
downloadexternal_llvm-5caa883afc2c768c293757d4ca30d85b9094e876.zip
external_llvm-5caa883afc2c768c293757d4ca30d85b9094e876.tar.gz
external_llvm-5caa883afc2c768c293757d4ca30d85b9094e876.tar.bz2
Don't call isInvariantLoad twice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63729 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/MachineLICM.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/CodeGen/MachineLICM.cpp b/lib/CodeGen/MachineLICM.cpp
index 0a9f720..10ee8d6 100644
--- a/lib/CodeGen/MachineLICM.cpp
+++ b/lib/CodeGen/MachineLICM.cpp
@@ -276,18 +276,11 @@ static bool HasOnlyPHIUses(unsigned Reg, MachineRegisterInfo *RegInfo) {
bool MachineLICM::IsProfitableToHoist(MachineInstr &MI) {
const TargetInstrDesc &TID = MI.getDesc();
- bool isInvLoad = false;
- if (TID.mayLoad()) {
- isInvLoad = TII->isInvariantLoad(&MI);
- if (!isInvLoad)
- return false;
- }
-
// FIXME: For now, only hoist re-materilizable instructions. LICM will
// increase register pressure. We want to make sure it doesn't increase
// spilling.
- if (!isInvLoad && (!TID.isRematerializable() ||
- !TII->isTriviallyReMaterializable(&MI)))
+ if (!TID.mayLoad() && (!TID.isRematerializable() ||
+ !TII->isTriviallyReMaterializable(&MI)))
return false;
if (!TID.isAsCheapAsAMove())