xref: /aosp_15_r20/external/llvm/test/Transforms/InstCombine/pow-3.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Test that the pow won't get simplified to sqrt(fabs) when they are not available.
2*9880d681SAndroid Build Coastguard Worker;
3*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -disable-simplify-libcalls -instcombine -S | FileCheck %s
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdeclare double @llvm.pow.f64(double %Val, double %Power)
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdefine double @test_simplify_unavailable(double %x) {
8*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: @test_simplify_unavailable(
9*9880d681SAndroid Build Coastguard Worker  %retval = call double @llvm.pow.f64(double %x, double 0.5)
10*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: call double @llvm.pow.f64(double %x, double 5.000000e-01)
11*9880d681SAndroid Build Coastguard Worker  ret double %retval
12*9880d681SAndroid Build Coastguard Worker}
13