Skip to content

Commit 1a300af

Browse files
committed
[MachineLICM] Let targets decide if copy-like instructions are cheap
When checking whether it is profitable to hoist an instruction, the pass may override a target's ruling because it assumes that all COPY instructions are cheap, and that may not be the case for all micro-architectures. On AArch64 there's 0% difference in performance in LLVM's test-suite.
1 parent 5224a17 commit 1a300af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/MachineLICM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ bool MachineLICMImpl::HasHighOperandLatency(MachineInstr &MI, unsigned DefIdx,
12191219
/// Return true if the instruction is marked "cheap" or the operand latency
12201220
/// between its def and a use is one or less.
12211221
bool MachineLICMImpl::IsCheapInstruction(MachineInstr &MI) const {
1222-
if (TII->isAsCheapAsAMove(MI) || MI.isCopyLike())
1222+
if (TII->isAsCheapAsAMove(MI) || MI.isSubregToReg())
12231223
return true;
12241224

12251225
bool isCheap = false;

0 commit comments

Comments
 (0)