Skip to content

Commit 59d558a

Browse files
committed
[X86] Add test for PR64589 (NFC)
1 parent cfc9298 commit 59d558a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

llvm/test/CodeGen/X86/pr64589.ll

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2+
; RUN: llc -mtriple=x86_64-- < %s | FileCheck %s
3+
4+
; FIXME: This is a miscompile.
5+
; It's not possible to directly or the two loads together, because this might
6+
; propagate a poison value from the second load (which has !range but not
7+
; !noundef).
8+
define i8 @test(ptr %p) {
9+
; CHECK-LABEL: test:
10+
; CHECK: # %bb.0:
11+
; CHECK-NEXT: movzbl (%rdi), %eax
12+
; CHECK-NEXT: orb 1(%rdi), %al
13+
; CHECK-NEXT: addb %al, %al
14+
; CHECK-NEXT: retq
15+
%v1 = load i8, ptr %p, align 4, !range !0, !noundef !{}
16+
%cmp1 = icmp ne i8 %v1, 0
17+
%p2 = getelementptr inbounds i8, ptr %p, i64 1
18+
%v2 = load i8, ptr %p2, align 1, !range !0
19+
%cmp2 = icmp ne i8 %v2, 0
20+
%or = select i1 %cmp1, i1 true, i1 %cmp2
21+
%res = select i1 %or, i8 2, i8 0
22+
ret i8 %res
23+
}
24+
25+
!0 = !{i8 0, i8 2}

0 commit comments

Comments
 (0)