From 4ac0d16c40e7d25e98805565c6e5d8ff9c10d15d Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 8 Oct 2010 18:59:19 +0000 Subject: Don't waste time unfolding simple loads. The unfolded copy won't be hoisted. llvm-svn: 116081 --- llvm/lib/CodeGen/MachineLICM.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib') diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp index 32b7e00ce66..b996d916076 100644 --- a/llvm/lib/CodeGen/MachineLICM.cpp +++ b/llvm/lib/CodeGen/MachineLICM.cpp @@ -636,6 +636,10 @@ bool MachineLICM::IsProfitableToHoist(MachineInstr &MI) { } MachineInstr *MachineLICM::ExtractHoistableLoad(MachineInstr *MI) { + // Don't unfold simple loads. + if (MI->getDesc().canFoldAsLoad()) + return 0; + // If not, we may be able to unfold a load and hoist that. // First test whether the instruction is loading from an amenable // memory location. -- cgit v1.2.3