From 87b02d5bbca0824fd590377fd3fba7c71e945186 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 9 Oct 2009 23:27:56 +0000 Subject: Factor out LiveIntervalAnalysis' code to determine whether an instruction is trivially rematerializable and integrate it into TargetInstrInfo::isTriviallyReMaterializable. This way, all places that need to know whether an instruction is rematerializable will get the same answer. This enables the useful parts of the aggressive-remat option by default -- using AliasAnalysis to determine whether a memory location is invariant, and removes the questionable parts -- rematting operations with virtual register inputs that may not be live everywhere. llvm-svn: 83687 --- llvm/lib/CodeGen/MachineLICM.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/MachineLICM.cpp') diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp index 5612899875b..f92ddb2b908 100644 --- a/llvm/lib/CodeGen/MachineLICM.cpp +++ b/llvm/lib/CodeGen/MachineLICM.cpp @@ -317,12 +317,10 @@ bool MachineLICM::IsProfitableToHoist(MachineInstr &MI) { if (MI.getOpcode() == TargetInstrInfo::IMPLICIT_DEF) return false; - const TargetInstrDesc &TID = MI.getDesc(); - // FIXME: For now, only hoist re-materilizable instructions. LICM will // increase register pressure. We want to make sure it doesn't increase // spilling. - if (!TII->isTriviallyReMaterializable(&MI)) + if (!TII->isTriviallyReMaterializable(&MI, AA)) return false; // If result(s) of this instruction is used by PHIs, then don't hoist it. -- cgit v1.2.3