1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00

[InstCombine][test] add tests for icmp simplify miscompile (PR50944); NFC

This commit is contained in:
Sanjay Patel 2021-07-01 13:36:46 -04:00
parent c26c170592
commit 01dbad81cc

View File

@ -3930,3 +3930,23 @@ bb:
%i3 = icmp eq i32 %i, %i2 %i3 = icmp eq i32 %i, %i2
ret i1 %i3 ret i1 %i3
} }
; PR50944
define i1 @thread_cmp_over_select_with_poison_trueval(i1 %b) {
; CHECK-LABEL: @thread_cmp_over_select_with_poison_trueval(
; CHECK-NEXT: ret i1 poison
;
%s = select i1 %b, i32 poison, i32 0
%tobool = icmp ne i32 %s, 0
ret i1 %tobool
}
define i1 @thread_cmp_over_select_with_poison_falseval(i1 %b) {
; CHECK-LABEL: @thread_cmp_over_select_with_poison_falseval(
; CHECK-NEXT: ret i1 poison
;
%s = select i1 %b, i32 1, i32 poison
%tobool = icmp ne i32 %s, 0
ret i1 %tobool
}