Skip to content

Commit c2dd9c9

Browse files
jroelofszahiraam
authored andcommitted
Revert "[ARM] Always lower direct calls as direct when the outliner is enabled (llvm#66434)"
This reverts commit 003bcad. ARM folks say it regresses some of their benchmarks: llvm#66434 (comment)
1 parent 7696ea2 commit c2dd9c9

File tree

4 files changed

+5
-21
lines changed

4 files changed

+5
-21
lines changed

llvm/lib/CodeGen/TargetPassConfig.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,9 +1241,6 @@ void TargetPassConfig::addMachinePasses() {
12411241
addPass(&LiveDebugValuesID);
12421242
addPass(&MachineSanitizerBinaryMetadataID);
12431243

1244-
if (EnableMachineOutliner == RunOutliner::NeverOutline)
1245-
TM->Options.EnableMachineOutliner = false;
1246-
12471244
if (TM->Options.EnableMachineOutliner &&
12481245
getOptLevel() != CodeGenOptLevel::None &&
12491246
EnableMachineOutliner != RunOutliner::NeverOutline) {

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,14 +2395,6 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
23952395
return isa<Instruction>(U) &&
23962396
cast<Instruction>(U)->getParent() == BB;
23972397
}) > 2;
2398-
// The indirect call lowering hinders the MachineOutliner's ability to
2399-
// recognize common sequences. The resulting indirect calls all have the
2400-
// same target, but the outliner can't tell this a priori, since the
2401-
// branch target is turned into a register operand, and those can't (yet?)
2402-
// be assumed to have the same value at runtime.
2403-
const TargetOptions &Options = DAG.getTarget().Options;
2404-
if (Options.EnableMachineOutliner)
2405-
PreferIndirect = false;
24062398
}
24072399
}
24082400
if (isTailCall) {

llvm/test/CodeGen/ARM/minsize-call-cse.ll

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
; RUN: llc < %s | FileCheck %s --check-prefixes=OUTLINER,CHECK
2-
; RUN: llc -enable-machine-outliner=always < %s | FileCheck %s --check-prefixes=OUTLINER,CHECK
3-
; RUN: llc -enable-machine-outliner=never < %s | FileCheck %s --check-prefixes=INDIRECT,CHECK
1+
; RUN: llc < %s | FileCheck %s
42

53
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
64
target triple = "thumbv7m-arm-none-eabi"
75

86
; CHECK-LABEL: f:
9-
; OUTLINER: bl g
10-
; OUTLINER: bl g
11-
; OUTLINER: bl g
12-
; INDIRECT: blx r
13-
; INDIRECT: blx r
14-
; INDIRECT: blx r
7+
; CHECK: blx r
8+
; CHECK: blx r
9+
; CHECK: blx r
1510
define void @f() minsize optsize {
1611
entry:
1712
call void @g(i32 45, i32 66)

llvm/test/CodeGen/ARM/pr42062.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc -o - %s -enable-machine-outliner=never 2>&1 | FileCheck %s --implicit-check-not=error
2+
; RUN: llc -o - %s 2>&1 | FileCheck %s --implicit-check-not=error
33
target triple = "thumbv8m.base-arm-none-eabi"
44
@foo = external global i8
55
declare i32 @bar(ptr nocapture, i32, i32, ptr nocapture)

0 commit comments

Comments
 (0)