1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
4 declare i8 @llvm.abs.i8(i8, i1)
5 declare <8 x i8> @llvm.abs.v8i8(<8 x i8>, i1)
7 define i8 @undef_val_min_poison() {
8 ; CHECK-LABEL: @undef_val_min_poison(
9 ; CHECK-NEXT: ret i8 poison
11 %r = call i8 @llvm.abs.i8(i8 undef, i1 true)
15 define i8 @undef_val_min_not_poison() {
16 ; CHECK-LABEL: @undef_val_min_not_poison(
17 ; CHECK-NEXT: ret i8 0
19 %r = call i8 @llvm.abs.i8(i8 undef, i1 false)
23 define i8 @min_val_min_poison() {
24 ; CHECK-LABEL: @min_val_min_poison(
25 ; CHECK-NEXT: ret i8 poison
27 %r = call i8 @llvm.abs.i8(i8 -128, i1 true)
31 define i8 @min_val_min_not_poison() {
32 ; CHECK-LABEL: @min_val_min_not_poison(
33 ; CHECK-NEXT: ret i8 -128
35 %r = call i8 @llvm.abs.i8(i8 -128, i1 false)
39 define <8 x i8> @vec_const() {
40 ; CHECK-LABEL: @vec_const(
41 ; CHECK-NEXT: ret <8 x i8> <i8 127, i8 126, i8 42, i8 1, i8 0, i8 1, i8 42, i8 127>
43 %r = call <8 x i8> @llvm.abs.v8i8(<8 x i8> <i8 -127, i8 -126, i8 -42, i8 -1, i8 0, i8 1, i8 42, i8 127>, i1 1)