xref: /llvm-project/llvm/test/Transforms/InstCombine/exp2-2.ll (revision 55c0719557a9789f7ab42623d9a2e7f884fc253e)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; Test that the exp2 library call simplifier works correctly.
3;
4; RUN: opt < %s -passes=instcombine -S | FileCheck %s
5
6target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
7
8declare float @exp2(double)
9
10; Check that exp2 functions with the wrong prototype aren't simplified.
11
12define float @test_no_simplify1(i32 %x) {
13; CHECK-LABEL: @test_no_simplify1(
14; CHECK-NEXT:    [[CONV:%.*]] = sitofp i32 [[X:%.*]] to double
15; CHECK-NEXT:    [[RET:%.*]] = call float @exp2(double [[CONV]])
16; CHECK-NEXT:    ret float [[RET]]
17;
18  %conv = sitofp i32 %x to double
19  %ret = call float @exp2(double %conv)
20  ret float %ret
21}
22