Skip to content

Commit 0d28b92

Browse files
authored
[AArch64] Don't run loop-idiom-vectorize pass in the O0 pipeline (#156802)
As noted in #156787
1 parent 5c8c59d commit 0d28b92

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

llvm/lib/Target/AArch64/AArch64TargetMachine.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,8 @@ void AArch64TargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
589589

590590
PB.registerLateLoopOptimizationsEPCallback(
591591
[=](LoopPassManager &LPM, OptimizationLevel Level) {
592-
LPM.addPass(LoopIdiomVectorizePass());
592+
if (Level != OptimizationLevel::O0)
593+
LPM.addPass(LoopIdiomVectorizePass());
593594
});
594595
if (getTargetTriple().isOSWindows())
595596
PB.registerPipelineEarlySimplificationEPCallback(

llvm/lib/Target/AArch64/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ add_llvm_target(AArch64CodeGen
108108
Core
109109
GlobalISel
110110
MC
111+
Passes
111112
Scalar
112113
SelectionDAG
113114
Support
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
; RUN: opt -mtriple=aarch64 -S -passes='default<O0>' -print-pipeline-passes < %s | FileCheck --check-prefix=O0 %s
2+
; RUN: opt -mtriple=aarch64 -S -passes='default<O2>' -print-pipeline-passes < %s | FileCheck %s
3+
4+
; CHECK: loop-idiom-vectorize
5+
; O0: {{^}}function(ee-instrument<>),always-inline,coro-cond(coro-early,cgscc(coro-split),coro-cleanup,globaldce),function(annotation-remarks),verify,print{{$}}
6+
7+
define void @foo() {
8+
entry:
9+
ret void
10+
}

0 commit comments

Comments
 (0)