1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -passes=instsimplify -S < %s | FileCheck %s
4 define i1 @test_powi_even_exp(float %x) {
5 ; CHECK-LABEL: define i1 @test_powi_even_exp(
6 ; CHECK-SAME: float [[X:%.*]]) {
7 ; CHECK-NEXT: ret i1 false
9 %y = call float @llvm.powi.f32(float %x, i32 8)
10 %cmp = fcmp olt float %y, 0.0
14 define i1 @test_powi_base(float nofpclass(ninf nnorm nsub nzero) %x, i32 %e) {
15 ; CHECK-LABEL: define i1 @test_powi_base(
16 ; CHECK-SAME: float nofpclass(ninf nzero nsub nnorm) [[X:%.*]], i32 [[E:%.*]]) {
17 ; CHECK-NEXT: ret i1 false
19 %y = call float @llvm.powi.f32(float %x, i32 %e)
20 %cmp = fcmp olt float %y, 0.0
24 define i1 @test_powi_base_without_nsz(float nofpclass(ninf nnorm nsub) %x, i32 %e) {
25 ; CHECK-LABEL: define i1 @test_powi_base_without_nsz(
26 ; CHECK-SAME: float nofpclass(ninf nsub nnorm) [[X:%.*]], i32 [[E:%.*]]) {
27 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.powi.f32.i32(float [[X]], i32 [[E]])
28 ; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[Y]], 0.000000e+00
29 ; CHECK-NEXT: ret i1 [[CMP]]
31 %y = call float @llvm.powi.f32(float %x, i32 %e)
32 %cmp = fcmp olt float %y, 0.0
36 define float @pr31702(float %x, i32 %n) {
37 ; CHECK-LABEL: define float @pr31702(
38 ; CHECK-SAME: float [[X:%.*]], i32 [[N:%.*]]) {
40 ; CHECK-NEXT: [[CALL1:%.*]] = call float @llvm.powi.f32.i32(float -0.000000e+00, i32 [[N]])
41 ; CHECK-NEXT: [[CALL2:%.*]] = call float @llvm.fabs.f32(float [[CALL1]])
42 ; CHECK-NEXT: ret float [[CALL2]]
45 %call1 = call float @llvm.powi.f32(float -0.0, i32 %n)
46 %call2 = call float @llvm.fabs.f32(float %call1)
50 declare float @llvm.powi.f32(float, i32)
51 declare float @llvm.fabs.f32(float)