Skip to content

[PassManager] Mark Loop RequireAnalysis as OptionalPassInfoMixin#196345

Merged
boomanaiden154 merged 1 commit into
llvm:mainfrom
boomanaiden154:lpm-fix-optnone-require-analysis
May 7, 2026
Merged

[PassManager] Mark Loop RequireAnalysis as OptionalPassInfoMixin#196345
boomanaiden154 merged 1 commit into
llvm:mainfrom
boomanaiden154:lpm-fix-optnone-require-analysis

Conversation

@boomanaiden154
Copy link
Copy Markdown
Contributor

#192120 marked this as RequiredPassInfoMixin, deviating from previous behavior. This is probably fine for Function/Module analyses, but doesn't work well for loop analyses in the case that we have a loop in an optnone function that is not in LCSSA. The LCSSA pass will not run because it is optional, the analysis will get computed, and then we assert because the loop is out of LCSSA at the end of the LPM.

Restore the old behavior of just not marking the pass as required as it seems reasonable enough.

\llvm#192120 marked this as RequiredPassInfoMixin, deviating from previous
behavior. This is probably fine for Function/Module analyses, but
doesn't work well for loop analyses in the case that we have a loop in
an optnone function that is not in LCSSA. The LCSSA pass will not run
because it is optional, the analysis will get computed, and then we
assert because the loop is out of LCSSA at the end of the LPM.

Restore the old behavior of just not marking the pass as required as it
seems reasonable enough.
@llvmorg-github-actions
Copy link
Copy Markdown

@llvm/pr-subscribers-llvm-transforms

Author: Aiden Grossman (boomanaiden154)

Changes

#192120 marked this as RequiredPassInfoMixin, deviating from previous behavior. This is probably fine for Function/Module analyses, but doesn't work well for loop analyses in the case that we have a loop in an optnone function that is not in LCSSA. The LCSSA pass will not run because it is optional, the analysis will get computed, and then we assert because the loop is out of LCSSA at the end of the LPM.

Restore the old behavior of just not marking the pass as required as it seems reasonable enough.


Full diff: https://github.com/llvm/llvm-project/pull/196345.diff

2 Files Affected:

  • (modified) llvm/include/llvm/Transforms/Scalar/LoopPassManager.h (+1-1)
  • (added) llvm/test/Other/lpm-require-analysis-optnone.ll (+29)
diff --git a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
index de9e63c125f5e..973d8a3cb1008 100644
--- a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
+++ b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h
@@ -184,7 +184,7 @@ typedef PassManager<Loop, LoopAnalysisManager, LoopStandardAnalysisResults &,
 template <typename AnalysisT>
 struct RequireAnalysisPass<AnalysisT, Loop, LoopAnalysisManager,
                            LoopStandardAnalysisResults &, LPMUpdater &>
-    : RequiredPassInfoMixin<
+    : OptionalPassInfoMixin<
           RequireAnalysisPass<AnalysisT, Loop, LoopAnalysisManager,
                               LoopStandardAnalysisResults &, LPMUpdater &>> {
   PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM,
diff --git a/llvm/test/Other/lpm-require-analysis-optnone.ll b/llvm/test/Other/lpm-require-analysis-optnone.ll
new file mode 100644
index 0000000000000..4e3c406852565
--- /dev/null
+++ b/llvm/test/Other/lpm-require-analysis-optnone.ll
@@ -0,0 +1,29 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt < %s -passes="require<no-op-loop>" -S | FileCheck %s
+
+;; Test that if we have a loop out of LCSSA in an optnone function, we do not
+;; assert when we require a loop analysis.
+
+define i32 @foo() #0 {
+; CHECK-LABEL: define i32 @foo(
+; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    br label %[[FOR_COND:.*]]
+; CHECK:       [[FOR_COND]]:
+; CHECK-NEXT:    [[TMP0:%.*]] = add i16 0, 0
+; CHECK-NEXT:    br i1 false, label %[[FOR_COND]], label %[[HANDLER_POINTER_OVERFLOW:.*]]
+; CHECK:       [[HANDLER_POINTER_OVERFLOW]]:
+; CHECK-NEXT:    [[TMP1:%.*]] = zext i16 [[TMP0]] to i32
+; CHECK-NEXT:    ret i32 [[TMP1]]
+;
+entry:
+  br label %for.cond
+for.cond:
+  %0 = add i16 0, 0
+  br i1 false, label %for.cond, label %handler.pointer_overflow
+handler.pointer_overflow:
+  %1 = zext i16 %0 to i32
+  ret i32 %1
+}
+
+attributes #0 = { noinline optnone }

Copy link
Copy Markdown
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@boomanaiden154 boomanaiden154 enabled auto-merge (squash) May 7, 2026 15:27
@boomanaiden154 boomanaiden154 merged commit 221a24e into llvm:main May 7, 2026
11 of 12 checks passed
@llvm-ci
Copy link
Copy Markdown

llvm-ci commented May 7, 2026

LLVM Buildbot has detected a new failure on builder openmp-offload-amdgpu-clang-flang running on rocm-worker-hw-01 while building llvm at step 3 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/67/builds/4290

Here is the relevant piece of the build log for the reference
Step 3 (annotate) failure: 'python ../llvm.src/offload/ci/openmp-offload-amdgpu-clang-flang.py ...' (failure)
...
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/declare_mapper_target_data_enter_exit.cpp (915 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/declare_mapper_target_update.cpp (916 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/map_ordering_tgt_data_alloc_from.c (917 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/map_ordering_tgt_alloc_tofrom.c (918 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/lambda_by_value.cpp (919 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/map_both_pointer_pointee.c (920 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/map_ordering_tgt_data_alloc_to_from.c (921 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/map_ordering_tgt_alloc_present_tofrom.c (922 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/map_ordering_tgt_data_alloc_tofrom.c (923 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/low_alignment.c (924 of 1345)
FAIL: libomptarget :: amdgcn-amd-amdhsa :: tools/omp-kernel-replay/record-replay-diff-threads.cpp (925 of 1345)
******************** TEST 'libomptarget :: amdgcn-amd-amdhsa :: tools/omp-kernel-replay/record-replay-diff-threads.cpp' FAILED ********************
Exit Code: 125

Command Output (stdout):
--
# RUN: at line 2
/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/clang++ -fopenmp    -I /home/botworker/builds/openmp-offload-amdgpu-clang-flang/llvm.src/offload/test -I /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib  -fopenmp-targets=amdgcn-amd-amdhsa /home/botworker/builds/openmp-offload-amdgpu-clang-flang/llvm.src/offload/test/tools/omp-kernel-replay/record-replay-diff-threads.cpp -o /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp -Xoffload-linker -lompdevice
# executed command: /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/clang++ -fopenmp -I /home/botworker/builds/openmp-offload-amdgpu-clang-flang/llvm.src/offload/test -I /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -fopenmp-targets=amdgcn-amd-amdhsa /home/botworker/builds/openmp-offload-amdgpu-clang-flang/llvm.src/offload/test/tools/omp-kernel-replay/record-replay-diff-threads.cpp -o /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp -Xoffload-linker -lompdevice
# note: command had no output on stdout or stderr
# RUN: at line 3
rm -rf /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir
# executed command: rm -rf /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir
# note: command had no output on stdout or stderr
# RUN: at line 4
mkdir -p /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir
# executed command: mkdir -p /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir
# note: command had no output on stdout or stderr
# RUN: at line 5
env LIBOMPTARGET_RECORD=1 LIBOMPTARGET_RECORD_MEMSIZE=536870912 LIBOMPTARGET_RECORD_DIR=/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp 2>&1 | /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-clang-flang/llvm.src/offload/test/tools/omp-kernel-replay/record-replay-diff-threads.cpp
# executed command: env LIBOMPTARGET_RECORD=1 LIBOMPTARGET_RECORD_MEMSIZE=536870912 LIBOMPTARGET_RECORD_DIR=/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp
# note: command had no output on stdout or stderr
# executed command: /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-clang-flang/llvm.src/offload/test/tools/omp-kernel-replay/record-replay-diff-threads.cpp
# note: command had no output on stdout or stderr
# RUN: at line 6
ls -t /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/*.json | sed -n '1p' | grep . | xargs -I {} /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/llvm-omp-kernel-replay --verify {}
# executed command: ls -t '/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/*.json'
# note: command had no output on stdout or stderr
# executed command: sed -n 1p
# note: command had no output on stdout or stderr
# executed command: grep .
# note: command had no output on stdout or stderr
# executed command: xargs -I '{}' /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/llvm-omp-kernel-replay --verify '{}'
# .---command stdout------------
# | [llvm-omp-kernel-replay] Replay time (1): 807051 ns
# | [llvm-omp-kernel-replay] Replay done, device memory verified
# `-----------------------------
# RUN: at line 7
ls -t /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/*.json | sed -n '1p' | grep . | xargs -I {} /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/llvm-omp-kernel-replay --verify --num-threads=1 {}
Step 9 (Add check check-offload) failure: Add check check-offload (failure)
...
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/declare_mapper_target_data_enter_exit.cpp (915 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/declare_mapper_target_update.cpp (916 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/map_ordering_tgt_data_alloc_from.c (917 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/map_ordering_tgt_alloc_tofrom.c (918 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/lambda_by_value.cpp (919 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/map_both_pointer_pointee.c (920 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/map_ordering_tgt_data_alloc_to_from.c (921 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/map_ordering_tgt_alloc_present_tofrom.c (922 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/map_ordering_tgt_data_alloc_tofrom.c (923 of 1345)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/low_alignment.c (924 of 1345)
FAIL: libomptarget :: amdgcn-amd-amdhsa :: tools/omp-kernel-replay/record-replay-diff-threads.cpp (925 of 1345)
******************** TEST 'libomptarget :: amdgcn-amd-amdhsa :: tools/omp-kernel-replay/record-replay-diff-threads.cpp' FAILED ********************
Exit Code: 125

Command Output (stdout):
--
# RUN: at line 2
/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/clang++ -fopenmp    -I /home/botworker/builds/openmp-offload-amdgpu-clang-flang/llvm.src/offload/test -I /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib  -fopenmp-targets=amdgcn-amd-amdhsa /home/botworker/builds/openmp-offload-amdgpu-clang-flang/llvm.src/offload/test/tools/omp-kernel-replay/record-replay-diff-threads.cpp -o /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp -Xoffload-linker -lompdevice
# executed command: /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/clang++ -fopenmp -I /home/botworker/builds/openmp-offload-amdgpu-clang-flang/llvm.src/offload/test -I /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -L /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -Wl,-rpath,/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./lib -fopenmp-targets=amdgcn-amd-amdhsa /home/botworker/builds/openmp-offload-amdgpu-clang-flang/llvm.src/offload/test/tools/omp-kernel-replay/record-replay-diff-threads.cpp -o /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp -Xoffload-linker -lompdevice
# note: command had no output on stdout or stderr
# RUN: at line 3
rm -rf /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir
# executed command: rm -rf /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir
# note: command had no output on stdout or stderr
# RUN: at line 4
mkdir -p /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir
# executed command: mkdir -p /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir
# note: command had no output on stdout or stderr
# RUN: at line 5
env LIBOMPTARGET_RECORD=1 LIBOMPTARGET_RECORD_MEMSIZE=536870912 LIBOMPTARGET_RECORD_DIR=/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp 2>&1 | /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-clang-flang/llvm.src/offload/test/tools/omp-kernel-replay/record-replay-diff-threads.cpp
# executed command: env LIBOMPTARGET_RECORD=1 LIBOMPTARGET_RECORD_MEMSIZE=536870912 LIBOMPTARGET_RECORD_DIR=/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp
# note: command had no output on stdout or stderr
# executed command: /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/FileCheck /home/botworker/builds/openmp-offload-amdgpu-clang-flang/llvm.src/offload/test/tools/omp-kernel-replay/record-replay-diff-threads.cpp
# note: command had no output on stdout or stderr
# RUN: at line 6
ls -t /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/*.json | sed -n '1p' | grep . | xargs -I {} /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/llvm-omp-kernel-replay --verify {}
# executed command: ls -t '/home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/*.json'
# note: command had no output on stdout or stderr
# executed command: sed -n 1p
# note: command had no output on stdout or stderr
# executed command: grep .
# note: command had no output on stdout or stderr
# executed command: xargs -I '{}' /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/llvm-omp-kernel-replay --verify '{}'
# .---command stdout------------
# | [llvm-omp-kernel-replay] Replay time (1): 807051 ns
# | [llvm-omp-kernel-replay] Replay done, device memory verified
# `-----------------------------
# RUN: at line 7
ls -t /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgcn-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/*.json | sed -n '1p' | grep . | xargs -I {} /home/botworker/builds/openmp-offload-amdgpu-clang-flang/build/llvm.build/./bin/llvm-omp-kernel-replay --verify --num-threads=1 {}

@aeubanks
Copy link
Copy Markdown
Contributor

aeubanks commented May 7, 2026

feels like if we can run arbitrary loop analyses in required loop passes, we should ensure the loop is in LCSSA form. so I'd suggest instead making LCSSA required

@boomanaiden154
Copy link
Copy Markdown
Contributor Author

feels like if we can run arbitrary loop analyses in required loop passes, we should ensure the loop is in LCSSA form. so I'd suggest instead making LCSSA required

I don't think there are any required loop passes which is why this wasn't an issue before. Making LCSSA required I think would transforms loops in optnone functions which might not hurt too much, but is probably still undesirable.

@aeubanks
Copy link
Copy Markdown
Contributor

aeubanks commented May 7, 2026

feels like if we can run arbitrary loop analyses in required loop passes, we should ensure the loop is in LCSSA form. so I'd suggest instead making LCSSA required

I don't think there are any required loop passes which is why this wasn't an issue before. Making LCSSA required I think would transforms loops in optnone functions which might not hurt too much, but is probably still undesirable.

ah I was thinking that we didn't have any loop passes in the -O0 pipeline but yeah we will be running -O3 on optnone functions, so I guess this is fine

moar55 pushed a commit to moar55/llvm-project that referenced this pull request May 12, 2026
…m#196345)

\llvm#192120 marked this as RequiredPassInfoMixin, deviating from previous
behavior. This is probably fine for Function/Module analyses, but
doesn't work well for loop analyses in the case that we have a loop in
an optnone function that is not in LCSSA. The LCSSA pass will not run
because it is optional, the analysis will get computed, and then we
assert because the loop is out of LCSSA at the end of the LPM.

Restore the old behavior of just not marking the pass as required as it
seems reasonable enough.
EuphoricThinking pushed a commit to EuphoricThinking/llvm-project that referenced this pull request May 14, 2026
…m#196345)

\llvm#192120 marked this as RequiredPassInfoMixin, deviating from previous
behavior. This is probably fine for Function/Module analyses, but
doesn't work well for loop analyses in the case that we have a loop in
an optnone function that is not in LCSSA. The LCSSA pass will not run
because it is optional, the analysis will get computed, and then we
assert because the loop is out of LCSSA at the end of the LPM.

Restore the old behavior of just not marking the pass as required as it
seems reasonable enough.
pedroMVicente pushed a commit to pedroMVicente/llvm-project that referenced this pull request May 19, 2026
…m#196345)

\llvm#192120 marked this as RequiredPassInfoMixin, deviating from previous
behavior. This is probably fine for Function/Module analyses, but
doesn't work well for loop analyses in the case that we have a loop in
an optnone function that is not in LCSSA. The LCSSA pass will not run
because it is optional, the analysis will get computed, and then we
assert because the loop is out of LCSSA at the end of the LPM.

Restore the old behavior of just not marking the pass as required as it
seems reasonable enough.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants