|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py |
| 2 | +; RUN: opt -S -instsimplify < %s | FileCheck %s |
| 3 | + |
| 4 | +declare double @llvm.log10.f64(double) |
| 5 | +declare double @llvm.pow.f64(double, double) |
| 6 | + |
| 7 | +define 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 | + |
| 18 | +define 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 | + |
| 29 | +define double @log10_reassoc_pow10_strict(double %x) { |
| 30 | +; CHECK-LABEL: @log10_reassoc_pow10_strict( |
| 31 | +; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.pow.f64(double 1.000000e+01, double [[X:%.*]]) |
| 32 | +; CHECK-NEXT: [[TMP2:%.*]] = call reassoc double @llvm.log10.f64(double [[TMP1]]) |
| 33 | +; CHECK-NEXT: ret double [[TMP2]] |
| 34 | +; |
| 35 | + %tmp = call double @llvm.pow.f64(double 1.000000e+01, double %x) |
| 36 | + %tmp1 = call reassoc double @llvm.log10.f64(double %tmp) |
| 37 | + ret double %tmp1 |
| 38 | +} |
| 39 | + |
| 40 | +define double @log10_pow10_reassoc(double %x) { |
| 41 | +; CHECK-LABEL: @log10_pow10_reassoc( |
| 42 | +; CHECK-NEXT: [[TMP1:%.*]] = call reassoc double @llvm.pow.f64(double 1.000000e+01, double [[X:%.*]]) |
| 43 | +; CHECK-NEXT: [[TMP2:%.*]] = call reassoc double @llvm.log10.f64(double [[TMP1]]) |
| 44 | +; CHECK-NEXT: ret double [[TMP2]] |
| 45 | +; |
| 46 | + %tmp = call reassoc double @llvm.pow.f64(double 1.000000e+01, double %x) |
| 47 | + %tmp1 = call reassoc double @llvm.log10.f64(double %tmp) |
| 48 | + ret double %tmp1 |
| 49 | +} |
0 commit comments