[PATCH] D134890: [X86] Pre-commit test case showing bug in combineOr (X86ISelLowering.cpp)

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 29 12:26:01 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGe4fcbf395009: [X86] Pre-commit test case showing bug in combineOr (X86ISelLowering.cpp) (authored by bjope).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134890/new/

https://reviews.llvm.org/D134890

Files:
  llvm/test/CodeGen/X86/or-lea.ll


Index: llvm/test/CodeGen/X86/or-lea.ll
===================================================================
--- llvm/test/CodeGen/X86/or-lea.ll
+++ llvm/test/CodeGen/X86/or-lea.ll
@@ -792,3 +792,34 @@
   %or = or i64 %sext, 8
   ret i64 %or
 }
+
+define i64 @or_large_constant(i64 %x) {
+; X86-LABEL: or_large_constant:
+; X86:       # %bb.0: # %entry
+; X86-NEXT:    xorl %edx, %edx
+; X86-NEXT:    movl $1, %eax
+; X86-NEXT:    cmpl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    movl $0, %eax
+; X86-NEXT:    sbbl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    setl %al
+; X86-NEXT:    movzbl %al, %eax
+; X86-NEXT:    negl %eax
+; X86-NEXT:    sbbl %edx, %edx
+; X86-NEXT:    orl $1, %eax
+; X86-NEXT:    orl $128, %edx
+; X86-NEXT:    retl
+;
+; X64-LABEL: or_large_constant:
+; X64:       # %bb.0: # %entry
+; X64-NEXT:    xorl %eax, %eax
+; X64-NEXT:    cmpq $2, %rdi
+; X64-NEXT:    setl %al
+; X64-NEXT:    leaq -1(%rax,%rax), %rax
+; X64-NEXT:    retq
+entry:
+  %cmp = icmp sgt i64 %x, 1
+  %zext = zext i1 %cmp to i64
+  %sub = sub i64 0, %zext
+  %or = or i64 %sub, 549755813889   ; 0x8000000001
+  ret i64 %or
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134890.463996.patch
Type: text/x-patch
Size: 1110 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220929/c904f06e/attachment.bin>


More information about the llvm-commits mailing list