Skip to content

Commit 114a59d

Browse files
committed
MachineLICM: Remove unnecessary isReg checks
COPY operands are always registers.
1 parent a9c73f6 commit 114a59d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/CodeGen/MachineLICM.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,9 +1265,8 @@ bool MachineLICMBase::IsProfitableToHoist(MachineInstr &MI,
12651265
// If we have a COPY with other uses in the loop, hoist to allow the users to
12661266
// also be hoisted.
12671267
Register DefReg;
1268-
if (MI.isCopy() && MI.getOperand(0).isReg() &&
1269-
(DefReg = MI.getOperand(0).getReg()).isVirtual() &&
1270-
MI.getOperand(1).isReg() && MI.getOperand(1).getReg().isVirtual() &&
1268+
if (MI.isCopy() && (DefReg = MI.getOperand(0).getReg()).isVirtual() &&
1269+
MI.getOperand(1).getReg().isVirtual() &&
12711270
IsLoopInvariantInst(MI, CurLoop) &&
12721271
any_of(MRI->use_nodbg_instructions(MI.getOperand(0).getReg()),
12731272
[&CurLoop, this, DefReg, Cost](MachineInstr &UseMI) {

0 commit comments

Comments
 (0)