1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -S -instsimplify < %s | FileCheck %s
3
4declare double @llvm.log10.f64(double)
5declare double @llvm.pow.f64(double, double)
6
7define double @log10_pow10(double %x) {
8; CHECK-LABEL: @log10_pow10(
9; CHECK-NEXT:    [[TMP1:%.*]] = call double @llvm.pow.f64(double 1.000000e+01, double [[X:%.*]])
10; CHECK-NEXT:    [[TMP2:%.*]] = call double @llvm.log10.f64(double [[TMP1]])
11; CHECK-NEXT:    ret double [[TMP2]]
12;
13  %tmp = call double @llvm.pow.f64(double 1.000000e+01, double %x)
14  %tmp1 = call double @llvm.log10.f64(double %tmp)
15  ret double %tmp1
16}
17
18define double @log10_strict_pow10_reassoc(double %x) {
19; CHECK-LABEL: @log10_strict_pow10_reassoc(
20; CHECK-NEXT:    [[TMP1:%.*]] = call reassoc double @llvm.pow.f64(double 1.000000e+01, double [[X:%.*]])
21; CHECK-NEXT:    [[TMP2:%.*]] = call double @llvm.log10.f64(double [[TMP1]])
22; CHECK-NEXT:    ret double [[TMP2]]
23;
24  %tmp = call reassoc double @llvm.pow.f64(double 1.000000e+01, double %x)
25  %tmp1 = call double @llvm.log10.f64(double %tmp)
26  ret double %tmp1
27}
28
29define double @log10_reassoc_pow10_strict(double %x) {
30; CHECK-LABEL: @log10_reassoc_pow10_strict(
31; CHECK-NEXT:    ret double [[X:%.*]]
32;
33  %tmp = call double @llvm.pow.f64(double 1.000000e+01, double %x)
34  %tmp1 = call reassoc double @llvm.log10.f64(double %tmp)
35  ret double %tmp1
36}
37
38define double @log10_pow10_reassoc(double %x) {
39; CHECK-LABEL: @log10_pow10_reassoc(
40; CHECK-NEXT:    ret double [[X:%.*]]
41;
42  %tmp = call reassoc double @llvm.pow.f64(double 1.000000e+01, double %x)
43  %tmp1 = call reassoc double @llvm.log10.f64(double %tmp)
44  ret double %tmp1
45}
46