Skip to content

Commit c8df2d1

Browse files
author
Valery N Dmitriev
committed
[NFC] Show instcombine powi simplifications drop FMF
Differential Revision: https://reviews.llvm.org/D95454
1 parent 74784a5 commit c8df2d1

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

llvm/test/Transforms/InstCombine/intrinsics.ll

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function powi
22
; RUN: opt -instcombine -S < %s | FileCheck %s
33

44
declare double @llvm.powi.f64(double, i32) nounwind readonly
@@ -21,17 +21,19 @@ declare double @llvm.rint.f64(double %Val) nounwind readonly
2121
declare double @llvm.nearbyint.f64(double %Val) nounwind readonly
2222

2323
define void @powi(double %V, double *%P) {
24-
%A = tail call double @llvm.powi.f64(double %V, i32 -1) nounwind
24+
; CHECK-LABEL: @powi(
25+
; CHECK-NEXT: [[A:%.*]] = fdiv double 1.000000e+00, [[V:%.*]]
26+
; CHECK-NEXT: store volatile double [[A]], double* [[P:%.*]], align 8
27+
; CHECK-NEXT: [[D:%.*]] = fmul double [[V]], [[V]]
28+
; CHECK-NEXT: store volatile double [[D]], double* [[P]], align 8
29+
; CHECK-NEXT: ret void
30+
;
31+
%A = tail call fast double @llvm.powi.f64(double %V, i32 -1) nounwind
2532
store volatile double %A, double* %P
2633

27-
%D = tail call double @llvm.powi.f64(double %V, i32 2) nounwind
34+
%D = tail call nnan double @llvm.powi.f64(double %V, i32 2) nounwind
2835
store volatile double %D, double* %P
2936
ret void
30-
; CHECK-LABEL: @powi(
31-
; CHECK: %A = fdiv double 1.0{{.*}}, %V
32-
; CHECK: store volatile double %A,
33-
; CHECK: %D = fmul double %V, %V
34-
; CHECK: store volatile double %D
3537
}
3638

3739
define i32 @cttz(i32 %a) {

0 commit comments

Comments
 (0)