Skip to content

Commit 2e8e435

Browse files
committed
Recommit "[RISCV] Don't run loop-idiom-vectorize pass in the O0 pipeline. (#156798)"
With a dependency on the Passes library added this time.
1 parent 4dade90 commit 2e8e435

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

llvm/lib/Target/RISCV/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ add_llvm_target(RISCVCodeGen
8888
GlobalISel
8989
IPO
9090
MC
91+
Passes
9192
RISCVDesc
9293
RISCVInfo
9394
Scalar

llvm/lib/Target/RISCV/RISCVTargetMachine.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,8 @@ void RISCVPassConfig::addPostRegAlloc() {
652652
void RISCVTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
653653
PB.registerLateLoopOptimizationsEPCallback([=](LoopPassManager &LPM,
654654
OptimizationLevel Level) {
655-
LPM.addPass(LoopIdiomVectorizePass(LoopIdiomVectorizeStyle::Predicated));
655+
if (Level != OptimizationLevel::O0)
656+
LPM.addPass(LoopIdiomVectorizePass(LoopIdiomVectorizeStyle::Predicated));
656657
});
657658
}
658659

0 commit comments

Comments
 (0)