Skip to content

Conversation

@dtcxzyw
Copy link
Member

@dtcxzyw dtcxzyw commented Jan 4, 2025

X <<s BW - 1 and X *s INT_MIN are not equivalent.
Alive2: https://alive2.llvm.org/ce/z/MKKFrj
Closes #121584

@dtcxzyw dtcxzyw requested a review from goldsteinn January 4, 2025 09:22
@dtcxzyw dtcxzyw requested a review from nikic as a code owner January 4, 2025 09:22
@llvmbot llvmbot added llvm:instcombine Covers the InstCombine, InstSimplify and AggressiveInstCombine passes llvm:transforms labels Jan 4, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 4, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Yingwei Zheng (dtcxzyw)

Changes

X &lt;&lt;s BW - 1 and X *s INT_MIN are not equivalent.
Alive2: https://alive2.llvm.org/ce/z/MKKFrj
Closes #121584


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

2 Files Affected:

  • (modified) llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp (+11-5)
  • (modified) llvm/test/Transforms/InstCombine/rem-mul-shl.ll (+13)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index f85a3c93651353..97a765ecfb6bd5 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -2066,14 +2066,18 @@ static Instruction *simplifyIRemMulShl(BinaryOperator &I,
   bool ShiftByX = false;
 
   // If V is not nullptr, it will be matched using m_Specific.
-  auto MatchShiftOrMulXC = [](Value *Op, Value *&V, APInt &C) -> bool {
+  auto MatchShiftOrMulXC = [](Value *Op, Value *&V, APInt &C,
+                              bool &PreserveNSW) -> bool {
     const APInt *Tmp = nullptr;
     if ((!V && match(Op, m_Mul(m_Value(V), m_APInt(Tmp)))) ||
         (V && match(Op, m_Mul(m_Specific(V), m_APInt(Tmp)))))
       C = *Tmp;
     else if ((!V && match(Op, m_Shl(m_Value(V), m_APInt(Tmp)))) ||
-             (V && match(Op, m_Shl(m_Specific(V), m_APInt(Tmp)))))
+             (V && match(Op, m_Shl(m_Specific(V), m_APInt(Tmp))))) {
       C = APInt(Tmp->getBitWidth(), 1) << *Tmp;
+      // We cannot preserve NSW when shifting by BW - 1.
+      PreserveNSW = Tmp->ult(Tmp->getBitWidth() - 1);
+    }
     if (Tmp != nullptr)
       return true;
 
@@ -2095,7 +2099,9 @@ static Instruction *simplifyIRemMulShl(BinaryOperator &I,
     return false;
   };
 
-  if (MatchShiftOrMulXC(Op0, X, Y) && MatchShiftOrMulXC(Op1, X, Z)) {
+  bool Op0PreserveNSW = true, Op1PreserveNSW = true;
+  if (MatchShiftOrMulXC(Op0, X, Y, Op0PreserveNSW) &&
+      MatchShiftOrMulXC(Op1, X, Z, Op1PreserveNSW)) {
     // pass
   } else if (MatchShiftCX(Op0, Y, X) && MatchShiftCX(Op1, Z, X)) {
     ShiftByX = true;
@@ -2108,7 +2114,7 @@ static Instruction *simplifyIRemMulShl(BinaryOperator &I,
   OverflowingBinaryOperator *BO0 = cast<OverflowingBinaryOperator>(Op0);
   // TODO: We may be able to deduce more about nsw/nuw of BO0/BO1 based on Y >=
   // Z or Z >= Y.
-  bool BO0HasNSW = BO0->hasNoSignedWrap();
+  bool BO0HasNSW = Op0PreserveNSW && BO0->hasNoSignedWrap();
   bool BO0HasNUW = BO0->hasNoUnsignedWrap();
   bool BO0NoWrap = IsSRem ? BO0HasNSW : BO0HasNUW;
 
@@ -2131,7 +2137,7 @@ static Instruction *simplifyIRemMulShl(BinaryOperator &I,
   };
 
   OverflowingBinaryOperator *BO1 = cast<OverflowingBinaryOperator>(Op1);
-  bool BO1HasNSW = BO1->hasNoSignedWrap();
+  bool BO1HasNSW = Op1PreserveNSW && BO1->hasNoSignedWrap();
   bool BO1HasNUW = BO1->hasNoUnsignedWrap();
   bool BO1NoWrap = IsSRem ? BO1HasNSW : BO1HasNUW;
   // (rem (mul X, Y), (mul nuw/nsw X, Z))
diff --git a/llvm/test/Transforms/InstCombine/rem-mul-shl.ll b/llvm/test/Transforms/InstCombine/rem-mul-shl.ll
index e7d6cc7102c713..aa087129e45d35 100644
--- a/llvm/test/Transforms/InstCombine/rem-mul-shl.ll
+++ b/llvm/test/Transforms/InstCombine/rem-mul-shl.ll
@@ -372,6 +372,19 @@ define <2 x i8> @srem_XY_XZ_with_CY_gt_CZ_no_nuw_out(<2 x i8> %X) {
   ret <2 x i8> %r
 }
 
+define i8 @srem_XY_XZ_with_CY_gt_CZ_drop_nsw(i8 noundef %X) {
+; CHECK-LABEL: @srem_XY_XZ_with_CY_gt_CZ_drop_nsw(
+; CHECK-NEXT:    [[BO0:%.*]] = mul nsw i8 [[X:%.*]], 127
+; CHECK-NEXT:    [[BO1:%.*]] = shl nsw i8 [[X]], 7
+; CHECK-NEXT:    [[R:%.*]] = srem i8 [[BO1]], [[BO0]]
+; CHECK-NEXT:    ret i8 [[R]]
+;
+  %BO0 = mul nsw i8 %X, 127
+  %BO1 = shl nsw i8 %X, 7
+  %r = srem i8 %BO1, %BO0
+  ret i8 %r
+}
+
 define i8 @srem_XY_XZ_with_CY_gt_CZ_fail_missing_flag1(i8 %X) {
 ; CHECK-LABEL: @srem_XY_XZ_with_CY_gt_CZ_fail_missing_flag1(
 ; CHECK-NEXT:    [[BO0:%.*]] = mul nuw nsw i8 [[X:%.*]], 10

Copy link
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, though I think it would be good to test more cases (you currently test the flag only on one operand, for one of the cases).

ret i8 %r
}

define i8 @srem_XY_XZ_with_CY_gt_CZ_drop_nsw_commuted(i8 noundef %X) {
Copy link
Member Author

Choose a reason for hiding this comment

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

The original transform is valid: https://alive2.llvm.org/ce/z/htzvgR
But I don't know how to generalize this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Think its okay if the shl is the rhs of the rem: https://alive2.llvm.org/ce/z/SoTDqo

Copy link
Contributor

Choose a reason for hiding this comment

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

So I think you can drop Op1PreserveNSW

@dtcxzyw dtcxzyw merged commit 24c2ba0 into llvm:main Jan 4, 2025
8 checks passed
@dtcxzyw dtcxzyw deleted the fix-rem-mul-shl branch January 4, 2025 17:20
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 4, 2025

LLVM Buildbot has detected a new failure on builder ml-opt-devrel-x86-64 running on ml-opt-devrel-x86-64-b1 while building llvm at step 6 "test-build-unified-tree-check-all".

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

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: ExecutionEngine/JITLink/RISCV/ELF_branch.s' FAILED ********************
Exit Code: 134

Command Output (stderr):
--
RUN: at line 1: rm -rf /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp && mkdir -p /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp
+ rm -rf /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp
+ mkdir -p /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp
RUN: at line 2: /b/ml-opt-devrel-x86-64-b1/build/bin/llvm-mc -triple=riscv64 -filetype=obj -riscv-asm-relax-branches=0      -o /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp/elf_riscv64_branch.o /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_branch.s
+ /b/ml-opt-devrel-x86-64-b1/build/bin/llvm-mc -triple=riscv64 -filetype=obj -riscv-asm-relax-branches=0 -o /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp/elf_riscv64_branch.o /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_branch.s
RUN: at line 4: /b/ml-opt-devrel-x86-64-b1/build/bin/llvm-mc -triple=riscv32 -filetype=obj -riscv-asm-relax-branches=0      -o /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp/elf_riscv32_branch.o /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_branch.s
+ /b/ml-opt-devrel-x86-64-b1/build/bin/llvm-mc -triple=riscv32 -filetype=obj -riscv-asm-relax-branches=0 -o /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp/elf_riscv32_branch.o /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_branch.s
RUN: at line 6: /b/ml-opt-devrel-x86-64-b1/build/bin/llvm-jitlink -noexec      -slab-allocate 100Kb -slab-address 0xfff00ff4 -slab-page-size 4096      -abs external_func_positive_offset=0xfff00ffc -abs external_func_negative_offset=0xfff00000     -check /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_branch.s /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp/elf_riscv64_branch.o
+ /b/ml-opt-devrel-x86-64-b1/build/bin/llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00ff4 -slab-page-size 4096 -abs external_func_positive_offset=0xfff00ffc -abs external_func_negative_offset=0xfff00000 -check /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_branch.s /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp/elf_riscv64_branch.o
RUN: at line 10: /b/ml-opt-devrel-x86-64-b1/build/bin/llvm-jitlink -noexec      -slab-allocate 100Kb -slab-address 0xfff00ff4 -slab-page-size 4096      -abs external_func_positive_offset=0xfff00ffc -abs external_func_negative_offset=0xfff00000      -check /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_branch.s /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp/elf_riscv32_branch.o
+ /b/ml-opt-devrel-x86-64-b1/build/bin/llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00ff4 -slab-page-size 4096 -abs external_func_positive_offset=0xfff00ffc -abs external_func_negative_offset=0xfff00000 -check /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_branch.s /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp/elf_riscv32_branch.o
llvm-jitlink: /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h:285: llvm::orc::SymbolStringPool::~SymbolStringPool(): Assertion `Pool.empty() && "Dangling references at pool destruction time"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /b/ml-opt-devrel-x86-64-b1/build/bin/llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00ff4 -slab-page-size 4096 -abs external_func_positive_offset=0xfff00ffc -abs external_func_negative_offset=0xfff00000 -check /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_branch.s /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp/elf_riscv32_branch.o
 #0 0x000056492d2bd458 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/b/ml-opt-devrel-x86-64-b1/build/bin/llvm-jitlink+0x1143458)
 #1 0x000056492d2ba83c SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f9fc2916140 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x13140)
 #3 0x00007f9fc240dd51 raise (/lib/x86_64-linux-gnu/libc.so.6+0x38d51)
 #4 0x00007f9fc23f7537 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22537)
 #5 0x00007f9fc23f740f (/lib/x86_64-linux-gnu/libc.so.6+0x2240f)
 #6 0x00007f9fc24066d2 (/lib/x86_64-linux-gnu/libc.so.6+0x316d2)
 #7 0x000056492c8bcd7f (/b/ml-opt-devrel-x86-64-b1/build/bin/llvm-jitlink+0x742d7f)
 #8 0x000056492d1695ba llvm::orc::ExecutorProcessControl::~ExecutorProcessControl() (/b/ml-opt-devrel-x86-64-b1/build/bin/llvm-jitlink+0xfef5ba)
 #9 0x000056492d1697e3 llvm::orc::SelfExecutorProcessControl::~SelfExecutorProcessControl() crtstuff.c:0:0
#10 0x000056492d087ee6 llvm::orc::ExecutionSession::~ExecutionSession() (/b/ml-opt-devrel-x86-64-b1/build/bin/llvm-jitlink+0xf0dee6)
#11 0x000056492c86e2ce main (/b/ml-opt-devrel-x86-64-b1/build/bin/llvm-jitlink+0x6f42ce)
#12 0x00007f9fc23f8d7a __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d7a)
#13 0x000056492c8ac3fa _start (/b/ml-opt-devrel-x86-64-b1/build/bin/llvm-jitlink+0x7323fa)
/b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.script: line 5: 1263349 Aborted                 /b/ml-opt-devrel-x86-64-b1/build/bin/llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00ff4 -slab-page-size 4096 -abs external_func_positive_offset=0xfff00ffc -abs external_func_negative_offset=0xfff00000 -check /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/test/ExecutionEngine/JITLink/RISCV/ELF_branch.s /b/ml-opt-devrel-x86-64-b1/build/test/ExecutionEngine/JITLink/RISCV/Output/ELF_branch.s.tmp/elf_riscv32_branch.o

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 4, 2025

LLVM Buildbot has detected a new failure on builder clang-debian-cpp20 running on clang-debian-cpp20 while building llvm at step 6 "test-build-unified-tree-check-all".

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

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: ExecutionEngine/JITLink/x86-64/ELF_R_X86_64_32.s' FAILED ********************
Exit Code: 134

Command Output (stderr):
--
RUN: at line 1: /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-mc -triple=x86_64-unknown-linux -position-independent      -filetype=obj -o /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/test/ExecutionEngine/JITLink/x86-64/Output/ELF_R_X86_64_32.s.tmp.o /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_R_X86_64_32.s
+ /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-mc -triple=x86_64-unknown-linux -position-independent -filetype=obj -o /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/test/ExecutionEngine/JITLink/x86-64/Output/ELF_R_X86_64_32.s.tmp.o /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_R_X86_64_32.s
RUN: at line 3: /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-jitlink -noexec -abs X=0x12345678 -check=/vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_R_X86_64_32.s /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/test/ExecutionEngine/JITLink/x86-64/Output/ELF_R_X86_64_32.s.tmp.o
+ /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-jitlink -noexec -abs X=0x12345678 -check=/vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_R_X86_64_32.s /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/test/ExecutionEngine/JITLink/x86-64/Output/ELF_R_X86_64_32.s.tmp.o
llvm-jitlink error: Resource tracker 0x5d4be1fad1b0 became defunct
llvm-jitlink: /vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h:285: llvm::orc::SymbolStringPool::~SymbolStringPool(): Assertion `Pool.empty() && "Dangling references at pool destruction time"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-jitlink -noexec -abs X=0x12345678 -check=/vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_R_X86_64_32.s /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/test/ExecutionEngine/JITLink/x86-64/Output/ELF_R_X86_64_32.s.tmp.o
 #0 0x00005d4bddcb8b98 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-jitlink+0xeb5b98)
 #1 0x00005d4bddcb668d llvm::sys::RunSignalHandlers() (/vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-jitlink+0xeb368d)
 #2 0x00005d4bddcb9138 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007ce5d2a1b510 (/lib/x86_64-linux-gnu/libc.so.6+0x3c510)
 #4 0x00007ce5d2a690fc (/lib/x86_64-linux-gnu/libc.so.6+0x8a0fc)
 #5 0x00007ce5d2a1b472 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3c472)
 #6 0x00007ce5d2a054b2 abort (/lib/x86_64-linux-gnu/libc.so.6+0x264b2)
 #7 0x00007ce5d2a053d5 (/lib/x86_64-linux-gnu/libc.so.6+0x263d5)
 #8 0x00007ce5d2a143a2 (/lib/x86_64-linux-gnu/libc.so.6+0x353a2)
 #9 0x00005d4bdd551f0c (/vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-jitlink+0x74ef0c)
#10 0x00005d4bddb9bb37 llvm::orc::ExecutorProcessControl::~ExecutorProcessControl() (/vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-jitlink+0xd98b37)
#11 0x00005d4bddb9d27f llvm::orc::SelfExecutorProcessControl::~SelfExecutorProcessControl() (/vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-jitlink+0xd9a27f)
#12 0x00005d4bddacee88 llvm::orc::ExecutionSession::~ExecutionSession() (/vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-jitlink+0xccbe88)
#13 0x00005d4bdd52aedd llvm::Session::~Session() (/vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-jitlink+0x727edd)
#14 0x00005d4bdd535664 main (/vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-jitlink+0x732664)
#15 0x00007ce5d2a066ca (/lib/x86_64-linux-gnu/libc.so.6+0x276ca)
#16 0x00007ce5d2a06785 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x27785)
#17 0x00005d4bdd523671 _start (/vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-jitlink+0x720671)
/vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/test/ExecutionEngine/JITLink/x86-64/Output/ELF_R_X86_64_32.s.script: line 3: 1365555 Aborted                 /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/bin/llvm-jitlink -noexec -abs X=0x12345678 -check=/vol/worker/clang-debian-cpp20/clang-debian-cpp20/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/ELF_R_X86_64_32.s /vol/worker/clang-debian-cpp20/clang-debian-cpp20/build/test/ExecutionEngine/JITLink/x86-64/Output/ELF_R_X86_64_32.s.tmp.o

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 4, 2025

LLVM Buildbot has detected a new failure on builder clang-aarch64-sve2-vla-2stage running on linaro-g4-02 while building llvm at step 12 "ninja check 2".

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

Here is the relevant piece of the build log for the reference
Step 12 (ninja check 2) failure: stage 2 checked (failure)
******************** TEST 'MLIR :: Integration/Dialect/Vector/CPU/ArmSVE/sve.mlir' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/bin/mlir-opt /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/sve.mlir -lower-affine -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm="enable-arm-sve" -finalize-memref-to-llvm -convert-func-to-llvm -convert-arith-to-llvm -convert-cf-to-llvm -canonicalize |  mlir-cpu-runner -e=entry -entry-point-result=void --march=aarch64 --mattr="+sve" -shared-libs=/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/./lib/libmlir_c_runner_utils.so |  /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/sve.mlir
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/bin/mlir-opt /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/sve.mlir -lower-affine -convert-vector-to-scf -convert-scf-to-cf -convert-vector-to-llvm=enable-arm-sve -finalize-memref-to-llvm -convert-func-to-llvm -convert-arith-to-llvm -convert-cf-to-llvm -canonicalize
# .---command stderr------------
# | /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/sve.mlir:84:11: error: null operand found
# |     %lc = arith.addf %la, %lb : vector<[4]xf32>
# |           ^
# | /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/sve.mlir:84:11: note: see current operation: %25 = "arith.addf"(<<NULL VALUE>>, %24) <{fastmath = #arith.fastmath<none>}> : (<<NULL TYPE>>, vector<[4]xf32>) -> vector<[4]xf32>
# `-----------------------------
# error: command failed with exit status: 1
# executed command: mlir-cpu-runner -e=entry -entry-point-result=void --march=aarch64 --mattr=+sve -shared-libs=/home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/./lib/libmlir_c_runner_utils.so
# .---command stderr------------
# | Error: entry point not found
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/sve.mlir
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-aarch64-sve2-vla-2stage/llvm/mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/sve.mlir
# `-----------------------------
# error: command failed with exit status: 2

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 4, 2025

LLVM Buildbot has detected a new failure on builder clang-ppc64-aix running on aix-ppc64 while building llvm at step 6 "test-build-unified-tree-check-all".

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

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'lit :: googletest-timeout.py' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 9
not env -u FILECHECK_OPTS "/opt/freeware/bin/python3.9" /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/utils/lit/lit.py -j1 --order=lexical -v Inputs/googletest-timeout    --param gtest_filter=InfiniteLoopSubTest --timeout=1 > /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/utils/lit/tests/Output/googletest-timeout.py.tmp.cmd.out
# executed command: not env -u FILECHECK_OPTS /opt/freeware/bin/python3.9 /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/utils/lit/lit.py -j1 --order=lexical -v Inputs/googletest-timeout --param gtest_filter=InfiniteLoopSubTest --timeout=1
# .---command stderr------------
# | lit.py: /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/utils/lit/lit/main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 1 seconds was requested on the command line. Forcing timeout to be 1 seconds.
# `-----------------------------
# RUN: at line 11
FileCheck --check-prefix=CHECK-INF < /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/utils/lit/tests/Output/googletest-timeout.py.tmp.cmd.out /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/utils/lit/tests/googletest-timeout.py
# executed command: FileCheck --check-prefix=CHECK-INF /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/utils/lit/tests/googletest-timeout.py
# RUN: at line 16
not env -u FILECHECK_OPTS "/opt/freeware/bin/python3.9" /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/utils/lit/lit.py -j1 --order=lexical -v Inputs/googletest-timeout   --param gtest_filter=InfiniteLoopSubTest  --param set_timeout=1   > /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/utils/lit/tests/Output/googletest-timeout.py.tmp.cfgset.out
# executed command: not env -u FILECHECK_OPTS /opt/freeware/bin/python3.9 /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/utils/lit/lit.py -j1 --order=lexical -v Inputs/googletest-timeout --param gtest_filter=InfiniteLoopSubTest --param set_timeout=1
# .---command stderr------------
# | Invalid pid specified: 47513966
# | /bin/sh: kill: bad argument count
# `-----------------------------
# RUN: at line 19
FileCheck --check-prefix=CHECK-INF < /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/utils/lit/tests/Output/googletest-timeout.py.tmp.cfgset.out /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/utils/lit/tests/googletest-timeout.py
# executed command: FileCheck --check-prefix=CHECK-INF /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/utils/lit/tests/googletest-timeout.py
# .---command stderr------------
# | /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/utils/lit/tests/googletest-timeout.py:34:14: error: CHECK-INF: expected string not found in input
# | # CHECK-INF: Timed Out: 1
# |              ^
# | <stdin>:13:29: note: scanning from here
# | Reached timeout of 1 seconds
# |                             ^
# | <stdin>:37:2: note: possible intended match here
# |  Timed Out: 2 (100.00%)
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/utils/lit/tests/googletest-timeout.py
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |             8:  
# |             9:  
# |            10: -- 
# |            11: exit: -9 
# |            12: -- 
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:instcombine Covers the InstCombine, InstSimplify and AggressiveInstCombine passes llvm:transforms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[InstCombine] Miscompilation in simplifyIRemMulShl

5 participants