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
4 ; It's not possible to directly or the two loads together, because this might
5 ; propagate a poison value from the second load (which has !range but not
7 define i8 @test(ptr %p) {
10 ; CHECK-NEXT: movzbl 1(%rdi), %eax
11 ; CHECK-NEXT: orb (%rdi), %al
12 ; CHECK-NEXT: setne %al
13 ; CHECK-NEXT: addb %al, %al
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