diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-02-04 09:21:58 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-02-04 09:21:58 +0000 |
commit | 4ded601445532cf730e544129a643665722b7acc (patch) | |
tree | 241f47dbd05054f74c3386850a736d4e54838f82 /llvm/lib/CodeGen/MachineLICM.cpp | |
parent | 1d9f7ac8ccb2938e7d22379330be0b8e8d4c4e04 (diff) | |
download | bcm5719-llvm-4ded601445532cf730e544129a643665722b7acc.tar.gz bcm5719-llvm-4ded601445532cf730e544129a643665722b7acc.zip |
Don't call isInvariantLoad twice.
llvm-svn: 63729
Diffstat (limited to 'llvm/lib/CodeGen/MachineLICM.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineLICM.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp index 0a9f7207b1f..10ee8d6d137 100644 --- a/llvm/lib/CodeGen/MachineLICM.cpp +++ b/llvm/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()) |