Skip to content

Commit

Permalink
[NewGVN][NFC] add poison tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nunoplopes committed Jan 30, 2022
1 parent 5a2020d commit 42a761e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions llvm/test/Transforms/NewGVN/basic.ll
Expand Up @@ -41,3 +41,29 @@ define i8 @simplify_add_poison(i8 %x) {
%r = add i8 poison, %x
ret i8 %r
}

define i8 @simplify_xor_poison(i8 %x) {
; CHECK-LABEL: @simplify_xor_poison(
; CHECK-NEXT: [[R:%.*]] = xor i8 poison, [[X:%.*]]
; CHECK-NEXT: ret i8 [[R]]
;
%r = xor i8 poison, %x
ret i8 %r
}

define i8 @simplify_sdiv_poison(i8 %x) {
; CHECK-LABEL: @simplify_sdiv_poison(
; CHECK-NEXT: ret i8 poison
;
%r = sdiv i8 poison, %x
ret i8 %r
}

define i8 @simplify_urem_poison(i8 %x) {
; CHECK-LABEL: @simplify_urem_poison(
; CHECK-NEXT: [[R:%.*]] = urem i8 [[X:%.*]], poison
; CHECK-NEXT: ret i8 [[R]]
;
%r = urem i8 %x, poison
ret i8 %r
}

0 comments on commit 42a761e

Please sign in to comment.