Don't call isInvariantLoad twice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63729 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2009-02-04 09:21:58 +00:00
parent 45e94d68d7
commit 5caa883afc

View File

@ -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())