Skip to content

Commit 4c81a2b

Browse files
committed
Commit tests for changes in revision D41940
llvm-svn: 352734
1 parent 12062e0 commit 4c81a2b

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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.log2.f64(double)
5+
declare double @llvm.pow.f64(double, double)
6+
7+
define double @log2_pow2(double %x) {
8+
; CHECK-LABEL: @log2_pow2(
9+
; CHECK-NEXT: [[TMP:%.*]] = call double @llvm.pow.f64(double 2.000000e+00, double [[X:%.*]])
10+
; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.log2.f64(double [[TMP]])
11+
; CHECK-NEXT: ret double [[TMP1]]
12+
;
13+
%tmp = call double @llvm.pow.f64(double 2.000000e+00, double %x)
14+
%tmp1 = call double @llvm.log2.f64(double %tmp)
15+
ret double %tmp1
16+
}
17+
18+
define double @log2_strict_pow2_reassoc(double %x) {
19+
; CHECK-LABEL: @log2_strict_pow2_reassoc(
20+
; CHECK-NEXT: [[TMP:%.*]] = call reassoc double @llvm.pow.f64(double 2.000000e+00, double [[X:%.*]])
21+
; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.log2.f64(double [[TMP]])
22+
; CHECK-NEXT: ret double [[TMP1]]
23+
;
24+
%tmp = call reassoc double @llvm.pow.f64(double 2.000000e+00, double %x)
25+
%tmp1 = call double @llvm.log2.f64(double %tmp)
26+
ret double %tmp1
27+
}
28+
29+
define double @log2_reassoc_pow2_strict(double %x) {
30+
; CHECK-LABEL: @log2_reassoc_pow2_strict(
31+
; CHECK-NEXT: [[TMP:%.*]] = call double @llvm.pow.f64(double 2.000000e+00, double [[X:%.*]])
32+
; CHECK-NEXT: [[TMP1:%.*]] = call reassoc double @llvm.log2.f64(double [[TMP]])
33+
; CHECK-NEXT: ret double [[TMP1]]
34+
;
35+
%tmp = call double @llvm.pow.f64(double 2.000000e+00, double %x)
36+
%tmp1 = call reassoc double @llvm.log2.f64(double %tmp)
37+
ret double %tmp1
38+
}
39+
40+
define double @log2_pow2_reassoc(double %x) {
41+
; CHECK-LABEL: @log2_pow2_reassoc(
42+
; CHECK-NEXT: [[TMP:%.*]] = call reassoc double @llvm.pow.f64(double 2.000000e+00, double [[X:%.*]])
43+
; CHECK-NEXT: [[TMP1:%.*]] = call reassoc double @llvm.log2.f64(double [[TMP]])
44+
; CHECK-NEXT: ret double [[TMP1]]
45+
;
46+
%tmp = call reassoc double @llvm.pow.f64(double 2.000000e+00, double %x)
47+
%tmp1 = call reassoc double @llvm.log2.f64(double %tmp)
48+
ret double %tmp1
49+
}

0 commit comments

Comments
 (0)