Skip to content

Conversation

@phoebewang
Copy link
Contributor

This reverts commit 2612dc9 but keeps Predicates = [HasNDD] removed.

There are two issues identified related to the change. One is INSERT_SUBREG cannot guarantee source and dest to be the same register. It mostly happens on O0. The other one is zero_extend is not a chain node, as a result, we will lose the chain for SETZUCCr.

…m#170806)"

This reverts commit 2612dc9 but keeps
`Predicates = [HasNDD]` removed.

There are two issues identified related to the change. One is
INSERT_SUBREG cannot guarantee source and dest to be the same register.
It mostly happens on O0. The other one is zero_extend is not a chain
node, as a result, we will lose the chain for SETZUCCr.
@phoebewang phoebewang enabled auto-merge (squash) December 14, 2025 03:40
@llvmbot
Copy link
Member

llvmbot commented Dec 14, 2025

@llvm/pr-subscribers-backend-x86

Author: Phoebe Wang (phoebewang)

Changes

This reverts commit 2612dc9 but keeps Predicates = [HasNDD] removed.

There are two issues identified related to the change. One is INSERT_SUBREG cannot guarantee source and dest to be the same register. It mostly happens on O0. The other one is zero_extend is not a chain node, as a result, we will lose the chain for SETZUCCr.


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

2 Files Affected:

  • (modified) llvm/lib/Target/X86/X86InstrCMovSetCC.td (-4)
  • (modified) llvm/test/CodeGen/X86/apx/setzucc.ll (-12)
diff --git a/llvm/lib/Target/X86/X86InstrCMovSetCC.td b/llvm/lib/Target/X86/X86InstrCMovSetCC.td
index b1599f2f37045..0b9172c1f2b6e 100644
--- a/llvm/lib/Target/X86/X86InstrCMovSetCC.td
+++ b/llvm/lib/Target/X86/X86InstrCMovSetCC.td
@@ -167,10 +167,6 @@ let Uses = [EFLAGS], isCodeGenOnly = 1, ForceDisassemble = 1,
   }
 }
 
-let Predicates = [HasZU] in
-  def : Pat<(i32 (zext (X86setcc timm:$cond, EFLAGS))),
-            (INSERT_SUBREG (i32 (IMPLICIT_DEF)), (SETZUCCr ccode:$cond), sub_8bit)>;
-
 // SALC is an undocumented instruction. Information for this instruction can be found
 // here http://www.rcollins.org/secrets/opcodes/SALC.html
 // Set AL if carry. 
diff --git a/llvm/test/CodeGen/X86/apx/setzucc.ll b/llvm/test/CodeGen/X86/apx/setzucc.ll
index d32ccf877137e..6eb2d6966ecd8 100644
--- a/llvm/test/CodeGen/X86/apx/setzucc.ll
+++ b/llvm/test/CodeGen/X86/apx/setzucc.ll
@@ -89,15 +89,3 @@ bb1:
 bb2:
   ret i32 0
 }
-
-define i32 @highmask_i32_mask32(i32 %val) {
-; CHECK-LABEL: highmask_i32_mask32:
-; CHECK:       # %bb.0:
-; CHECK-NEXT:    testl $-1048576, %edi # imm = 0xFFF00000
-; CHECK-NEXT:    setzune %al
-; CHECK-NEXT:    retq
-  %and = and i32 %val, -1048576
-  %cmp = icmp ne i32 %and, 0
-  %ret = zext i1 %cmp to i32
-  ret i32 %ret
-}

@phoebewang phoebewang merged commit f0557d8 into llvm:main Dec 14, 2025
11 of 12 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 14, 2025

LLVM Buildbot has detected a new failure on builder clang-armv7-global-isel running on linaro-clang-armv7-global-isel while building llvm at step 7 "ninja check 1".

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

Here is the relevant piece of the build log for the reference
Step 7 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'LLVM :: CodeGen/X86/2009-03-23-MultiUseSched.ll' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 3
/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/bin/llc < /home/tcwg-buildbot/worker/clang-armv7-global-isel/llvm/llvm/test/CodeGen/X86/2009-03-23-MultiUseSched.ll -mtriple=x86_64-linux -mcpu=corei7 -relocation-model=static | /home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-armv7-global-isel/llvm/llvm/test/CodeGen/X86/2009-03-23-MultiUseSched.ll
# executed command: /home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/bin/llc -mtriple=x86_64-linux -mcpu=corei7 -relocation-model=static
# .---command stderr------------
# | LLVM ERROR: out of memory
# | Allocation failed
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
# | Stack dump:
# | 0.	Program arguments: /home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/bin/llc -mtriple=x86_64-linux -mcpu=corei7 -relocation-model=static
# | 1.	Running pass 'Function Pass Manager' on module '<stdin>'.
# | 2.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@foo'
# | #0 0x0d6e6610 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/bin/llc+0x39d6610)
# | #1 0x0d6e3ad4 llvm::sys::RunSignalHandlers() (/home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/bin/llc+0x39d3ad4)
# | #2 0x0d6e75d0 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
# | #3 0xf108d6f0 __default_rt_sa_restorer ./signal/../sysdeps/unix/sysv/linux/arm/sigrestorer.S:80:0
# | #4 0xf107db06 ./csu/../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47:0
# | #5 0xf10bd292 __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
# | #6 0xf108c840 gsignal ./signal/../sysdeps/posix/raise.c:27:6
# `-----------------------------
# error: command failed with exit status: -6
# executed command: /home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-armv7-global-isel/llvm/llvm/test/CodeGen/X86/2009-03-23-MultiUseSched.ll
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /home/tcwg-buildbot/worker/clang-armv7-global-isel/stage1/bin/FileCheck /home/tcwg-buildbot/worker/clang-armv7-global-isel/llvm/llvm/test/CodeGen/X86/2009-03-23-MultiUseSched.ll
# `-----------------------------
# error: command failed with exit status: 2

--

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


@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 14, 2025

LLVM Buildbot has detected a new failure on builder reverse-iteration running on hexagon-build-03 while building llvm at step 6 "check_all".

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

Here is the relevant piece of the build log for the reference
Step 6 (check_all) failure: test (failure)
******************** TEST 'Clang :: Interpreter/dynamic-library.cpp' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 17
cat /local/mnt/workspace/bots/hexagon-build-03/reverse-iteration/llvm.src/clang/test/Interpreter/dynamic-library.cpp | env LD_LIBRARY_PATH=/local/mnt/workspace/bots/hexagon-build-03/reverse-iteration/llvm.src/clang/test/Interpreter/Inputs:$LD_LIBRARY_PATH /local/mnt/workspace/bots/hexagon-build-03/reverse-iteration/llvm.obj/bin/clang-repl | /local/mnt/workspace/bots/hexagon-build-03/reverse-iteration/llvm.obj/bin/FileCheck /local/mnt/workspace/bots/hexagon-build-03/reverse-iteration/llvm.src/clang/test/Interpreter/dynamic-library.cpp
# executed command: cat /local/mnt/workspace/bots/hexagon-build-03/reverse-iteration/llvm.src/clang/test/Interpreter/dynamic-library.cpp
# .---command stdout------------
# | // REQUIRES: host-supports-jit, x86_64-linux
# | 
# | // To generate libdynamic-library-test.so :
# | // clang -xc++ -o libdynamic-library-test.so -fPIC -shared
# | //
# | // extern "C" {
# | //
# | // int ultimate_answer = 0;
# | // 
# | // int calculate_answer() {
# | //   ultimate_answer = 42;
# | //   return 5;
# | // }
# | //
# | // }
# | 
# | // RUN: cat %s | env LD_LIBRARY_PATH=%S/Inputs:$LD_LIBRARY_PATH clang-repl | FileCheck %s
# | 
# | extern "C" int printf(const char* format, ...);
# | 
# | extern "C" int ultimate_answer;
# | extern "C" int calculate_answer();
# | 
# | %lib libdynamic-library-test.so
# | 
# | printf("Return value: %d\n", calculate_answer());
# | // CHECK: Return value: 5
# | 
# | printf("Variable: %d\n", ultimate_answer);
# | // CHECK-NEXT: Variable: 42
# | 
# | %quit
# `-----------------------------
# executed command: env 'LD_LIBRARY_PATH=/local/mnt/workspace/bots/hexagon-build-03/reverse-iteration/llvm.src/clang/test/Interpreter/Inputs:$LD_LIBRARY_PATH' /local/mnt/workspace/bots/hexagon-build-03/reverse-iteration/llvm.obj/bin/clang-repl
# .---command stderr------------
# | /local/mnt/workspace/bots/hexagon-build-03/reverse-iteration/llvm.obj/bin/clang-repl: error while loading shared libraries: libc++.so.1: cannot open shared object file: No such file or directory
# `-----------------------------
# error: command failed with exit status: 127
# executed command: /local/mnt/workspace/bots/hexagon-build-03/reverse-iteration/llvm.obj/bin/FileCheck /local/mnt/workspace/bots/hexagon-build-03/reverse-iteration/llvm.src/clang/test/Interpreter/dynamic-library.cpp
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
...

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.

3 participants