1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=instsimplify < %s | FileCheck %s
4 declare double @llvm.log10.f64(double)
5 declare double @llvm.pow.f64(double, double)
7 define double @log10_pow10(double %x) {
8 ; CHECK-LABEL: @log10_pow10(
9 ; CHECK-NEXT: [[TMP:%.*]] = call double @llvm.pow.f64(double 1.000000e+01, double [[X:%.*]])
10 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.log10.f64(double [[TMP]])
11 ; CHECK-NEXT: ret double [[TMP1]]
13 %tmp = call double @llvm.pow.f64(double 1.000000e+01, double %x)
14 %tmp1 = call double @llvm.log10.f64(double %tmp)
18 define double @log10_strict_pow10_reassoc(double %x) {
19 ; CHECK-LABEL: @log10_strict_pow10_reassoc(
20 ; CHECK-NEXT: [[TMP:%.*]] = call reassoc double @llvm.pow.f64(double 1.000000e+01, double [[X:%.*]])
21 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.log10.f64(double [[TMP]])
22 ; CHECK-NEXT: ret double [[TMP1]]
24 %tmp = call reassoc double @llvm.pow.f64(double 1.000000e+01, double %x)
25 %tmp1 = call double @llvm.log10.f64(double %tmp)
29 define double @log10_reassoc_pow10_strict(double %x) {
30 ; CHECK-LABEL: @log10_reassoc_pow10_strict(
31 ; CHECK-NEXT: ret double [[X:%.*]]
33 %tmp = call double @llvm.pow.f64(double 1.000000e+01, double %x)
34 %tmp1 = call reassoc double @llvm.log10.f64(double %tmp)
38 define double @log10_pow10_reassoc(double %x) {
39 ; CHECK-LABEL: @log10_pow10_reassoc(
40 ; CHECK-NEXT: ret double [[X:%.*]]
42 %tmp = call reassoc double @llvm.pow.f64(double 1.000000e+01, double %x)
43 %tmp1 = call reassoc double @llvm.log10.f64(double %tmp)