Skip to content

Commit e2c27fd

Browse files
committed
[X86] X86FixupInstTuning - hoist OptSize flag. NFC.
Allow reuse in a future patch.
1 parent 0586023 commit e2c27fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/X86/X86FixupInstTuning.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ bool X86FixupInstTuningPass::processInstruction(
8181
MachineInstr &MI = *I;
8282
unsigned Opc = MI.getOpcode();
8383
unsigned NumOperands = MI.getDesc().getNumOperands();
84+
bool OptSize = MF.getFunction().hasOptSize();
8485

8586
auto GetInstTput = [&](unsigned Opcode) -> std::optional<double> {
8687
// We already checked that SchedModel exists in `NewOpcPreferable`.
@@ -226,8 +227,7 @@ bool X86FixupInstTuningPass::processInstruction(
226227
unsigned MovImm) -> bool {
227228
if ((MI.getOperand(NumOperands - 1).getImm() & Mask) != MovImm)
228229
return false;
229-
bool Force = MF.getFunction().hasOptSize();
230-
if (!Force && !NewOpcPreferable(MovOpc))
230+
if (!OptSize && !NewOpcPreferable(MovOpc))
231231
return false;
232232
MI.setDesc(TII->get(MovOpc));
233233
MI.removeOperand(NumOperands - 1);

0 commit comments

Comments
 (0)