[llvm] edc1bcf - [PassBuilder] Detect loop-mssa for licm with parameters (PR60149)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 23 03:13:16 PST 2023
Author: Nikita Popov
Date: 2023-01-23T12:11:33+01:00
New Revision: edc1bcfc24e2a676e013775eb71a951e49b9d4f1
URL: https://github.com/llvm/llvm-project/commit/edc1bcfc24e2a676e013775eb71a951e49b9d4f1
DIFF: https://github.com/llvm/llvm-project/commit/edc1bcfc24e2a676e013775eb71a951e49b9d4f1.diff
LOG: [PassBuilder] Detect loop-mssa for licm with parameters (PR60149)
When auto-detecting loop-mssa for licm/lnicm, also handle the case
where there are pass parameters.
Fixes https://github.com/llvm/llvm-project/issues/60149.
Added:
Modified:
llvm/lib/Passes/PassBuilder.cpp
llvm/test/Transforms/LICM/allow-speculation-option.ll
Removed:
################################################################################
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index a50dde1d41c20..e251d56463a3f 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -1018,7 +1018,7 @@ static bool isLoopNestPassName(StringRef Name, CallbacksT &Callbacks,
if (parseRepeatPassName(Name))
return true;
- if (Name == "lnicm") {
+ if (checkParametrizedPassName(Name, "lnicm")) {
UseMemorySSA = true;
return true;
}
@@ -1040,7 +1040,7 @@ static bool isLoopPassName(StringRef Name, CallbacksT &Callbacks,
if (parseRepeatPassName(Name))
return true;
- if (Name == "licm") {
+ if (checkParametrizedPassName(Name, "licm")) {
UseMemorySSA = true;
return true;
}
diff --git a/llvm/test/Transforms/LICM/allow-speculation-option.ll b/llvm/test/Transforms/LICM/allow-speculation-option.ll
index cf36e013bdc83..0951b2d413355 100644
--- a/llvm/test/Transforms/LICM/allow-speculation-option.ll
+++ b/llvm/test/Transforms/LICM/allow-speculation-option.ll
@@ -1,7 +1,9 @@
; RUN: opt -passes='loop-mssa(licm<allowspeculation>)' -S %s | FileCheck --check-prefixes=COMMON,SPEC_ON %s
; RUN: opt -passes='loop-mssa(licm<no-allowspeculation>)' -S %s | FileCheck --check-prefixes=COMMON,SPEC_OFF %s
+; RUN: opt -passes='licm<no-allowspeculation>' -S %s | FileCheck --check-prefixes=COMMON,SPEC_OFF %s
; RUN: opt -passes='loop-mssa(lnicm<allowspeculation>)' -S %s | FileCheck --check-prefixes=COMMON,SPEC_ON %s
; RUN: opt -passes='loop-mssa(lnicm<no-allowspeculation>)' -S %s | FileCheck --check-prefixes=COMMON,SPEC_OFF %s
+; RUN: opt -passes='lnicm<no-allowspeculation>' -S %s | FileCheck --check-prefixes=COMMON,SPEC_OFF %s
define void @test(ptr %ptr, i32 %N) {
; COMMON-LABEL: @test(
More information about the llvm-commits
mailing list