Skip to content

[ConstFold] Fold fixed-vectors in constantFoldIntrinsic - #213625

Merged
artagnon merged 1 commit into
llvm:mainfrom
artagnon:constfolder-simplintr-fixedvec
Aug 3, 2026
Merged

[ConstFold] Fold fixed-vectors in constantFoldIntrinsic#213625
artagnon merged 1 commit into
llvm:mainfrom
artagnon:constfolder-simplintr-fixedvec

Conversation

@artagnon

@artagnon artagnon commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This exposes an underlying bug in wasm.dot-folding, which we fix. The motivation for this patch is to enable folding of get.active.lane.mask in VPlan in a follow-up.

This exposes an underlying bug in wasm.dot-folding, which we fix. The
motivation for this patch is to enable folding of get.active.lane.mask
in VPlan in a follow-up.
@artagnon
artagnon requested review from david-arm and dtcxzyw August 3, 2026 09:06
@artagnon
artagnon requested a review from nikic as a code owner August 3, 2026 09:06
@llvmorg-github-actions llvmorg-github-actions Bot added llvm:instcombine Covers the InstCombine, InstSimplify and AggressiveInstCombine passes llvm:analysis Includes value tracking, cost tables and constant folding llvm:transforms labels Aug 3, 2026
@llvmorg-github-actions

llvmorg-github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

@llvm/pr-subscribers-llvm-analysis

@llvm/pr-subscribers-llvm-transforms

Author: Ramkumar Ramachandra (artagnon)

Changes

This exposes an underlying bug in wasm.dot-folding, which we fix. The motivation for this patch is to enable folding of get.active.lane.mask in VPlan in a follow-up.


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

6 Files Affected:

  • (modified) llvm/include/llvm/Analysis/ConstantFolding.h (+1)
  • (modified) llvm/include/llvm/Analysis/TargetFolder.h (+2-1)
  • (modified) llvm/lib/Analysis/ConstantFolding.cpp (+9-4)
  • (modified) llvm/lib/Analysis/InstructionSimplify.cpp (+1-1)
  • (modified) llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp (+1-1)
  • (modified) llvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/dot.ll (+9)
diff --git a/llvm/include/llvm/Analysis/ConstantFolding.h b/llvm/include/llvm/Analysis/ConstantFolding.h
index 4ea0a6f69e81b..87867d6f5303e 100644
--- a/llvm/include/llvm/Analysis/ConstantFolding.h
+++ b/llvm/include/llvm/Analysis/ConstantFolding.h
@@ -171,6 +171,7 @@ LLVM_ABI Constant *ConstantFoldCall(const CallBase *Call, Function *F,
 
 LLVM_ABI Constant *ConstantFoldIntrinsic(Intrinsic::ID ID,
                                          ArrayRef<Constant *> Ops, Type *Ty,
+                                         const DataLayout &DL,
                                          Function *CxtF = nullptr);
 
 /// ConstantFoldLoadThroughBitcast - try to cast constant to destination type
diff --git a/llvm/include/llvm/Analysis/TargetFolder.h b/llvm/include/llvm/Analysis/TargetFolder.h
index 9bae2e4d5c974..80d798ee64356 100644
--- a/llvm/include/llvm/Analysis/TargetFolder.h
+++ b/llvm/include/llvm/Analysis/TargetFolder.h
@@ -196,7 +196,8 @@ class LLVM_ABI TargetFolder final : public IRBuilderFolder {
                        Function *CxtF = nullptr) const override {
     if (all_of(Ops, IsaPred<Constant>))
       return ConstantFoldIntrinsic(
-          ID, ArrayRef((Constant *const *)Ops.data(), Ops.size()), Ty, CxtF);
+          ID, ArrayRef((Constant *const *)Ops.data(), Ops.size()), Ty, DL,
+          CxtF);
     return nullptr;
   }
 
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index e5d52ece939c2..c7347aebbd2e3 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -4300,7 +4300,7 @@ static Constant *ConstantFoldScalarCall(StringRef Name,
 static Constant *ConstantFoldFixedVectorCall(
     StringRef Name, Intrinsic::ID IntrinsicID, FixedVectorType *FVTy,
     ArrayRef<Constant *> Operands, const DataLayout &DL,
-    const TargetLibraryInfo *TLI, const CallBase *Call) {
+    const TargetLibraryInfo *TLI = nullptr, const CallBase *Call = nullptr) {
   SmallVector<Constant *, 4> Result(FVTy->getNumElements());
   SmallVector<Constant *, 4> Lane(Operands.size());
   Type *Ty = FVTy->getElementType();
@@ -4466,9 +4466,12 @@ static Constant *ConstantFoldFixedVectorCall(
 
     for (unsigned I = 0; I < NumElements; ++I) {
       ConstantInt *Elt0 =
-          cast<ConstantInt>(Operands[0]->getAggregateElement(I));
+          dyn_cast<ConstantInt>(Operands[0]->getAggregateElement(I));
       ConstantInt *Elt1 =
-          cast<ConstantInt>(Operands[1]->getAggregateElement(I));
+          dyn_cast<ConstantInt>(Operands[1]->getAggregateElement(I));
+
+      if (!Elt0 || !Elt1)
+        return nullptr;
 
       MulVector[I] = Elt0->getSExtValue() * Elt1->getSExtValue();
     }
@@ -4713,13 +4716,15 @@ ConstantFoldStructCall(StringRef Name, Intrinsic::ID IntrinsicID,
 
 Constant *llvm::ConstantFoldIntrinsic(Intrinsic::ID ID,
                                       ArrayRef<Constant *> Ops, Type *Ty,
-                                      Function *CxtF) {
+                                      const DataLayout &DL, Function *CxtF) {
   // In the absence of CxtF, assume strictfp conservatively.
   if (!canConstantFoldIntrinsic(ID, CxtF ? CxtF->isStrictFP() : true) ||
       (DisableFPCallFolding &&
        anyTypeContainsFP(
            Ty, ArrayRef<Value *>((Value *const *)Ops.data(), Ops.size()))))
     return nullptr;
+  if (auto *FVTy = dyn_cast<FixedVectorType>(Ty))
+    return ConstantFoldFixedVectorCall("", ID, FVTy, Ops, DL);
   return ConstantFoldScalarCall("", ID, Ty, Ops);
 }
 
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index ec044be705ab0..10b159192c4be 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -7352,7 +7352,7 @@ Value *llvm::simplifyIntrinsic(Intrinsic::ID IID, Type *ReturnType,
   if (all_of(Args, IsaPred<Constant>))
     if (Constant *C = ConstantFoldIntrinsic(
             IID, ArrayRef((Constant *const *)Args.data(), Args.size()),
-            ReturnType, CxtF))
+            ReturnType, Q.DL, CxtF))
       return C;
 
   // Most of the intrinsics with no operands have some kind of side effect.
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
index 460024f607858..f109d3fd61640 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -2301,7 +2301,7 @@ Value *InstCombinerImpl::foldSelectWithConstOpToBinOp(ICmpInst *Cmp,
 
   auto FoldBinaryOpOrIntrinsic = [&](Constant *LHS, Constant *RHS) {
     return IsIntrinsic
-               ? ConstantFoldIntrinsic(Opcode, {LHS, RHS}, LHS->getType())
+               ? ConstantFoldIntrinsic(Opcode, {LHS, RHS}, LHS->getType(), DL)
                : ConstantFoldBinaryOpOperands(Opcode, LHS, RHS, DL);
   };
 
diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/dot.ll b/llvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/dot.ll
index d44437bd518af..dcb4b32152e8e 100644
--- a/llvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/dot.ll
+++ b/llvm/test/Transforms/InstSimplify/ConstProp/WebAssembly/dot.ll
@@ -28,6 +28,15 @@ define <4 x i32> @dot_nonzero() {
   ret <4 x i32> %res
 }
 
+define <4 x i32> @dot_poison() {
+; CHECK-LABEL: define <4 x i32> @dot_poison() {
+; CHECK-NEXT:    [[RES:%.*]] = tail call <4 x i32> @llvm.wasm.dot(<8 x i16> <i16 1, i16 poison, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8>, <8 x i16> <i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8>)
+; CHECK-NEXT:    ret <4 x i32> [[RES]]
+;
+  %res = tail call <4 x i32> @llvm.wasm.dot(<8 x i16> <i16 1, i16 poison, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8>, <8 x i16> <i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8>)
+  ret <4 x i32> %res
+}
+
 define <4 x i32> @dot_one_negative() {
 ; CHECK-LABEL: define <4 x i32> @dot_one_negative() {
 ; CHECK-NEXT:    ret <4 x i32> splat (i32 -2)

@david-arm david-arm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change seems reasonable to me!

@artagnon artagnon changed the title [ConstFold] Fold fixed-vectors in simplifyIntrinsic [ConstFold] Fold fixed-vectors in constantFoldIntrinsic Aug 3, 2026
@artagnon
artagnon merged commit d2b28a8 into llvm:main Aug 3, 2026
16 checks passed
@artagnon
artagnon deleted the constfolder-simplintr-fixedvec branch August 3, 2026 11:37
@llvm-ci

llvm-ci commented Aug 3, 2026

Copy link
Copy Markdown

LLVM Buildbot has detected a new failure on builder amdgpu-clang-flang running on AMD-bb-w-05 while building llvm at step 3 "annotate".

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

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/use_device_ptr/target_data_use_device_ptr_var_fallback.cpp (1175 of 1349)
UNSUPPORTED: libomptarget :: x86_64-unknown-linux-gnu :: offloading/small_trip_count.c (1176 of 1349)
UNSUPPORTED: libomptarget :: x86_64-unknown-linux-gnu :: offloading/small_trip_count_thread_limit.cpp (1177 of 1349)
UNSUPPORTED: libomptarget :: x86_64-unknown-linux-gnu :: offloading/spmdization.c (1178 of 1349)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/is_accessible.cpp (1179 of 1349)
PASS: libomptarget :: amdgpu-amd-amdhsa :: sanitizer/kernel_crash_async.c (1180 of 1349)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/use_device_ptr/target_data_use_device_ptr_var_ref_fallback_nullify.cpp (1181 of 1349)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/mapper_enter_data_always_present_ptee.c (1182 of 1349)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/use_device_ptr/target_data_use_device_ptr_var_ref_fallback.cpp (1183 of 1349)
PASS: libomptarget :: amdgpu-amd-amdhsa :: sanitizer/kernel_trap.c (1184 of 1349)
FAIL: libomptarget :: amdgpu-amd-amdhsa :: tools/omp-kernel-replay/record-replay-diff-threads.cpp (1185 of 1349)
******************** TEST 'libomptarget :: amdgpu-amd-amdhsa :: tools/omp-kernel-replay/record-replay-diff-threads.cpp' FAILED ********************
Exit Code: 125

Command Output (stdout):
--
# RUN: at line 2
/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./bin/clang++ -fopenmp    -I /home/botworker/bbot/amdgpu-clang-flang/llvm.src/offload/test -I /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib -Xoffload-linker -L/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/amdgpu-amd-amdhsa -Xoffload-linker -L/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/clang/24/lib/amdgpu-amd-amdhsa  -fopenmp-targets=amdgpu-amd-amdhsa /home/botworker/bbot/amdgpu-clang-flang/llvm.src/offload/test/tools/omp-kernel-replay/record-replay-diff-threads.cpp -o /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp -Xoffload-linker -lompdevice
# executed command: /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./bin/clang++ -fopenmp -I /home/botworker/bbot/amdgpu-clang-flang/llvm.src/offload/test -I /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib -Xoffload-linker -L/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/amdgpu-amd-amdhsa -Xoffload-linker -L/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/clang/24/lib/amdgpu-amd-amdhsa -fopenmp-targets=amdgpu-amd-amdhsa /home/botworker/bbot/amdgpu-clang-flang/llvm.src/offload/test/tools/omp-kernel-replay/record-replay-diff-threads.cpp -o /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-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/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir
# executed command: rm -rf /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-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/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir
# executed command: mkdir -p /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-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/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir LIBOMPTARGET_RECORD_REPORT_FILENAME=report.txt /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp 2>&1 | /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./bin/FileCheck /home/botworker/bbot/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/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir LIBOMPTARGET_RECORD_REPORT_FILENAME=report.txt /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-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/bbot/amdgpu-clang-flang/build/llvm.build/./bin/FileCheck /home/botworker/bbot/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
awk '/\.json/ {print $1}' /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/report.txt | tr -d ',' > /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/json_list.txt
# executed command: awk '/\.json/ {print $1}' /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/report.txt
# note: command had no output on stdout or stderr
# executed command: tr -d ,
# note: command had no output on stdout or stderr
# RUN: at line 7
cat /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/json_list.txt | count 1
# executed command: cat /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/json_list.txt
# note: command had no output on stdout or stderr
# executed command: count 1
# note: command had no output on stdout or stderr
# RUN: at line 8
ls -1 /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/*.json | count 1
# executed command: ls -1 '/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/*.json'
Step 9 (Add check check-offload) failure: Add check check-offload (failure)
...
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/use_device_ptr/target_data_use_device_ptr_var_fallback.cpp (1175 of 1349)
UNSUPPORTED: libomptarget :: x86_64-unknown-linux-gnu :: offloading/small_trip_count.c (1176 of 1349)
UNSUPPORTED: libomptarget :: x86_64-unknown-linux-gnu :: offloading/small_trip_count_thread_limit.cpp (1177 of 1349)
UNSUPPORTED: libomptarget :: x86_64-unknown-linux-gnu :: offloading/spmdization.c (1178 of 1349)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/is_accessible.cpp (1179 of 1349)
PASS: libomptarget :: amdgpu-amd-amdhsa :: sanitizer/kernel_crash_async.c (1180 of 1349)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/use_device_ptr/target_data_use_device_ptr_var_ref_fallback_nullify.cpp (1181 of 1349)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/mapper_enter_data_always_present_ptee.c (1182 of 1349)
PASS: libomptarget :: x86_64-unknown-linux-gnu :: mapping/use_device_ptr/target_data_use_device_ptr_var_ref_fallback.cpp (1183 of 1349)
PASS: libomptarget :: amdgpu-amd-amdhsa :: sanitizer/kernel_trap.c (1184 of 1349)
FAIL: libomptarget :: amdgpu-amd-amdhsa :: tools/omp-kernel-replay/record-replay-diff-threads.cpp (1185 of 1349)
******************** TEST 'libomptarget :: amdgpu-amd-amdhsa :: tools/omp-kernel-replay/record-replay-diff-threads.cpp' FAILED ********************
Exit Code: 125

Command Output (stdout):
--
# RUN: at line 2
/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./bin/clang++ -fopenmp    -I /home/botworker/bbot/amdgpu-clang-flang/llvm.src/offload/test -I /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib -Xoffload-linker -L/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/amdgpu-amd-amdhsa -Xoffload-linker -L/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/clang/24/lib/amdgpu-amd-amdhsa  -fopenmp-targets=amdgpu-amd-amdhsa /home/botworker/bbot/amdgpu-clang-flang/llvm.src/offload/test/tools/omp-kernel-replay/record-replay-diff-threads.cpp -o /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp -Xoffload-linker -lompdevice
# executed command: /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./bin/clang++ -fopenmp -I /home/botworker/bbot/amdgpu-clang-flang/llvm.src/offload/test -I /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib -L /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/x86_64-unknown-linux-gnu -Wl,-rpath,/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib -Xoffload-linker -L/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/amdgpu-amd-amdhsa -Xoffload-linker -L/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./lib/clang/24/lib/amdgpu-amd-amdhsa -fopenmp-targets=amdgpu-amd-amdhsa /home/botworker/bbot/amdgpu-clang-flang/llvm.src/offload/test/tools/omp-kernel-replay/record-replay-diff-threads.cpp -o /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-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/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir
# executed command: rm -rf /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-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/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir
# executed command: mkdir -p /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-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/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir LIBOMPTARGET_RECORD_REPORT_FILENAME=report.txt /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp 2>&1 | /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/./bin/FileCheck /home/botworker/bbot/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/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir LIBOMPTARGET_RECORD_REPORT_FILENAME=report.txt /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-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/bbot/amdgpu-clang-flang/build/llvm.build/./bin/FileCheck /home/botworker/bbot/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
awk '/\.json/ {print $1}' /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/report.txt | tr -d ',' > /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/json_list.txt
# executed command: awk '/\.json/ {print $1}' /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/report.txt
# note: command had no output on stdout or stderr
# executed command: tr -d ,
# note: command had no output on stdout or stderr
# RUN: at line 7
cat /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/json_list.txt | count 1
# executed command: cat /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/json_list.txt
# note: command had no output on stdout or stderr
# executed command: count 1
# note: command had no output on stdout or stderr
# RUN: at line 8
ls -1 /home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/*.json | count 1
# executed command: ls -1 '/home/botworker/bbot/amdgpu-clang-flang/build/llvm.build/runtimes/runtimes-bins/offload/test/amdgpu-amd-amdhsa/tools/omp-kernel-replay/Output/record-replay-diff-threads.cpp.tmp.testdir/*.json'

aobolensk pushed a commit to aobolensk/llvm-project that referenced this pull request Aug 3, 2026
This exposes an underlying bug in wasm.dot-folding, which we fix. The
motivation for this patch is to enable folding of get.active.lane.mask
in VPlan in a follow-up.
jgreenbaum pushed a commit to jgreenbaum/llvm-project that referenced this pull request Aug 3, 2026
This exposes an underlying bug in wasm.dot-folding, which we fix. The
motivation for this patch is to enable folding of get.active.lane.mask
in VPlan in a follow-up.
tfzee pushed a commit to tfzee/llvm-project that referenced this pull request Aug 6, 2026
This exposes an underlying bug in wasm.dot-folding, which we fix. The
motivation for this patch is to enable folding of get.active.lane.mask
in VPlan in a follow-up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:analysis Includes value tracking, cost tables and constant folding llvm:instcombine Covers the InstCombine, InstSimplify and AggressiveInstCombine passes llvm:transforms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants