Skip to content

Commit 4ac0d16

Browse files
author
Evan Cheng
committed
Don't waste time unfolding simple loads. The unfolded copy won't be hoisted.
llvm-svn: 116081
1 parent 8c5e7e5 commit 4ac0d16

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/CodeGen/MachineLICM.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,10 @@ bool MachineLICM::IsProfitableToHoist(MachineInstr &MI) {
636636
}
637637

638638
MachineInstr *MachineLICM::ExtractHoistableLoad(MachineInstr *MI) {
639+
// Don't unfold simple loads.
640+
if (MI->getDesc().canFoldAsLoad())
641+
return 0;
642+
639643
// If not, we may be able to unfold a load and hoist that.
640644
// First test whether the instruction is loading from an amenable
641645
// memory location.

0 commit comments

Comments
 (0)