Skip to content

Commit bbc4624

Browse files
committed
[RISCV][EVL] Disable the EVLIndVarSimplify Pass by default
1 parent 740758a commit bbc4624

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

llvm/lib/Target/RISCV/RISCVTargetMachine.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ static cl::opt<bool>
114114
cl::desc("Enable Machine Pipeliner for RISC-V"),
115115
cl::init(false), cl::Hidden);
116116

117+
static cl::opt<bool> EnableEVLIndVarSimplify(
118+
"riscv-simplify-evl-iv",
119+
cl::desc("Enable the EVLIndVarSimplify pass."), cl::init(false),
120+
cl::Hidden);
121+
117122
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeRISCVTarget() {
118123
RegisterTargetMachine<RISCVTargetMachine> X(getTheRISCV32Target());
119124
RegisterTargetMachine<RISCVTargetMachine> Y(getTheRISCV64Target());
@@ -645,7 +650,7 @@ void RISCVTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
645650

646651
PB.registerVectorizerEndEPCallback(
647652
[](FunctionPassManager &FPM, OptimizationLevel Level) {
648-
if (Level.isOptimizingForSpeed())
653+
if (Level.isOptimizingForSpeed() && EnableEVLIndVarSimplify)
649654
FPM.addPass(createFunctionToLoopPassAdaptor(EVLIndVarSimplifyPass()));
650655
});
651656
}

0 commit comments

Comments
 (0)