-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[RISCV][EVL] Drop EVLIndVarSimplifyPass from the pipeline #151483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-backend-risc-v Author: Shih-Po Hung (arcbbb) ChangesWith the VPlan-based canonical induction variable replacement landed in #147222, it appears to cover the functionality previously provided by the EVLIndVarSimplify pass introduced in #131005. As a next step, this patch proposes disabling EVLIndVarSimplify by default to begin a gradual phase-out. Full diff: https://github.com/llvm/llvm-project/pull/151483.diff 1 Files Affected:
diff --git a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
index da6ac2f6f31e9..9d648237743b4 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
@@ -114,6 +114,11 @@ static cl::opt<bool>
cl::desc("Enable Machine Pipeliner for RISC-V"),
cl::init(false), cl::Hidden);
+static cl::opt<bool> EnableEVLIndVarSimplify(
+ "riscv-simplify-evl-iv",
+ cl::desc("Enable the EVLIndVarSimplify pass."), cl::init(false),
+ cl::Hidden);
+
extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeRISCVTarget() {
RegisterTargetMachine<RISCVTargetMachine> X(getTheRISCV32Target());
RegisterTargetMachine<RISCVTargetMachine> Y(getTheRISCV64Target());
@@ -645,7 +650,7 @@ void RISCVTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
PB.registerVectorizerEndEPCallback(
[](FunctionPassManager &FPM, OptimizationLevel Level) {
- if (Level.isOptimizingForSpeed())
+ if (Level.isOptimizingForSpeed() && EnableEVLIndVarSimplify)
FPM.addPass(createFunctionToLoopPassAdaptor(EVLIndVarSimplifyPass()));
});
}
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're quite early in the LLVM release cycle, should we just go ahead and stop emitting the metadata from the LoopVectorizer and remove the pass?
I don't think EVLIndVarSimplfiyPass is actually kicking in today anymore, it always seems to bail with Cannot retrieve IV from loop vector.body becausecannot recognize induction variable
after #147222. So I'm not sure if adding a flag really changes anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we just go ahead and stop emitting the metadata
Personally I'll say we can stop emitting the metadata and remove it from RISCV's pipeline, but keeping the Pass just in case.
I'm ok with that too |
Let's handle the metadata in a separate PR and keep this one focused on removing the pass from the pipeline. @mshockwave I do have a question regarding the metadata. Does "stop emitting" imply a complete removal, or just adding a switch to disable it? I'm not sure it is consistent to remove the metadata entirely while there's still a pass that queries it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/123/builds/24704 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/137/builds/22971 Here is the relevant piece of the build log for the reference
|
Sorry this message slipped through my radar: yes, I think we could just add a switch to disable it for now. |
With the VPlan-based canonical induction variable replacement landed in #147222, it appears to cover the functionality previously provided by the EVLIndVarSimplify pass introduced in #131005.
This patch suggests removing EVLIndVarSimplify from the RISC-V pipeline as a follow-up step. Feedback is very welcome!