Skip to content

Commit 5e4480b

Browse files
committed
[ARM] Don't run the block placement pass at O0
The block placement pass shouldn't run unless optimisations are enabled. Differential Revision: https://reviews.llvm.org/D94691
1 parent e9f1ed2 commit 5e4480b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

llvm/lib/Target/ARM/ARMBlockPlacement.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ INITIALIZE_PASS(ARMBlockPlacement, DEBUG_TYPE, "ARM block placement", false,
5858
false)
5959

6060
bool ARMBlockPlacement::runOnMachineFunction(MachineFunction &MF) {
61+
if (skipFunction(MF.getFunction()))
62+
return false;
6163
const ARMSubtarget &ST = static_cast<const ARMSubtarget &>(MF.getSubtarget());
6264
if (!ST.hasLOB())
6365
return false;

llvm/lib/Target/ARM/ARMTargetMachine.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,11 +553,11 @@ void ARMPassConfig::addPreEmitPass() {
553553
return MF.getSubtarget<ARMSubtarget>().isThumb2();
554554
}));
555555

556-
addPass(createARMBlockPlacementPass());
557-
558-
// Don't optimize barriers at -O0.
559-
if (getOptLevel() != CodeGenOpt::None)
556+
// Don't optimize barriers or block placement at -O0.
557+
if (getOptLevel() != CodeGenOpt::None) {
558+
addPass(createARMBlockPlacementPass());
560559
addPass(createARMOptimizeBarriersPass());
560+
}
561561
}
562562

563563
void ARMPassConfig::addPreEmitPass2() {

0 commit comments

Comments
 (0)