xref: /aosp_15_r20/external/llvm/test/Transforms/InstCombine/pow-2.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Test that the pow library call simplifier works correctly.
2*9880d681SAndroid Build Coastguard Worker;
3*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -instcombine -S | FileCheck %s
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdeclare float @pow(double, double)
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; Check that pow functions with the wrong prototype aren't simplified.
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Workerdefine float @test_no_simplify1(double %x) {
10*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: @test_no_simplify1(
11*9880d681SAndroid Build Coastguard Worker  %retval = call float @pow(double 1.0, double %x)
12*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: call float @pow(double 1.000000e+00, double %x)
13*9880d681SAndroid Build Coastguard Worker  ret float %retval
14*9880d681SAndroid Build Coastguard Worker}
15