[llvm] [X86][Atomic] Fix bts/btr/btc regression caused by InstCombine trunc to i1 (PR #200667)

Jiří Filek via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 7 01:43:51 PDT 2026


================
@@ -0,0 +1,66 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: opt < %s -O2 | llc -mtriple=x86_64-unknown-linux-gnu | FileCheck %s --check-prefixes=CHECK,X64
+; RUN: opt < %s -O2 | llc -mtriple=i686-unknown-linux-gnu | FileCheck %s --check-prefixes=CHECK,X86
+
+; Regression tests for single bit atomics instruction codegen
+define i1 @or_check_bit0(ptr %v) nounwind {
+; X64-LABEL: or_check_bit0:
+; X64:       # %bb.0: # %entry
+; X64-NEXT:    lock btsl $0, (%rdi)
+; X64-NEXT:    setb %al
+; X64-NEXT:    retq
+;
+; X86-LABEL: or_check_bit0:
+; X86:       # %bb.0: # %entry
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    lock btsl $0, (%eax)
+; X86-NEXT:    setb %al
+; X86-NEXT:    retl
+entry:
----------------
fileho wrote:

removed

https://github.com/llvm/llvm-project/pull/200667


More information about the llvm-commits mailing list