Skip to content

Commit e467c5c

Browse files
committed
Set MIFlag only in pre-ra
1 parent 5095493 commit e467c5c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

llvm/lib/CodeGen/MacroFusion.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include "llvm/CodeGen/MacroFusion.h"
1515
#include "llvm/ADT/Statistic.h"
16+
#include "llvm/CodeGen/MachineFunction.h"
1617
#include "llvm/CodeGen/MachineInstr.h"
1718
#include "llvm/CodeGen/ScheduleDAG.h"
1819
#include "llvm/CodeGen/ScheduleDAGInstrs.h"
@@ -128,7 +129,12 @@ bool llvm::fuseInstructionPair(ScheduleDAGInstrs &DAG, SUnit &FirstSU,
128129
}
129130
}
130131

131-
SecondSU.getInstr()->setFlag(MachineInstr::Fusible);
132+
// Mark the second instruction of fusible pair as MachineInstr::Fusible if
133+
// this mutation is running in pre-ra scheduler.
134+
if (!DAG.MF.getProperties().hasProperty(
135+
MachineFunctionProperties::Property::NoVRegs))
136+
SecondSU.getInstr()->setFlag(MachineInstr::Fusible);
137+
132138
++NumFused;
133139
return true;
134140
}

0 commit comments

Comments
 (0)