summaryrefslogtreecommitdiff
path: root/test/Transforms/InstCombine/double-float-shrink-1.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/double-float-shrink-1.ll')
-rw-r--r--test/Transforms/InstCombine/double-float-shrink-1.ll128
1 files changed, 81 insertions, 47 deletions
diff --git a/test/Transforms/InstCombine/double-float-shrink-1.ll b/test/Transforms/InstCombine/double-float-shrink-1.ll
index c170f2ca74ba6..e8f7f720b1527 100644
--- a/test/Transforms/InstCombine/double-float-shrink-1.ll
+++ b/test/Transforms/InstCombine/double-float-shrink-1.ll
@@ -1,8 +1,8 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -instcombine -S | FileCheck %s
-
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
-target triple = "x86_64-unknown-linux-gnu"
+; RUN: opt < %s -instcombine -S -mtriple x86_64-unknown-linux-gnu | FileCheck %s --check-prefixes=CHECK,LINUX,ISC99
+; RUN: opt < %s -instcombine -S -mtriple x86_64-pc-win32 | FileCheck %s --check-prefixes=CHECK,ISC99
+; RUN: opt < %s -instcombine -S -mtriple x86_64-pc-windows-msvc16 | FileCheck %s --check-prefixes=CHECK,MS64,ISC89
+; RUN: opt < %s -instcombine -S -mtriple i386-pc-windows-msvc | FileCheck %s --check-prefixes=CHECK,ISC99
+; RUN: opt < %s -instcombine -S -mtriple i686-pc-windows-msvc17 | FileCheck %s --check-prefixes=CHECK,MS32,ISC89
; Check for and against shrinkage when using the
; unsafe-fp-math function attribute on a math lib
@@ -12,8 +12,10 @@ target triple = "x86_64-unknown-linux-gnu"
define float @acos_test1(float %f) {
; CHECK-LABEL: @acos_test1(
-; CHECK-NEXT: [[ACOSF:%.*]] = call fast float @acosf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[ACOSF]]
+; LINUX-NEXT: [[ACOSF:%.*]] = call fast float @acosf(float [[F:%.*]])
+; LINUX-NEXT: ret float [[ACOSF]]
+; MS32: [[ACOSF:%.*]] = call fast double @acos(double [[F:%.*]])
+; MS64-NEXT: [[ACOSF:%.*]] = call fast float @acosf(float [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @acos(double %conv)
@@ -34,8 +36,9 @@ define double @acos_test2(float %f) {
define float @acosh_test1(float %f) {
; CHECK-LABEL: @acosh_test1(
-; CHECK-NEXT: [[ACOSHF:%.*]] = call fast float @acoshf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[ACOSHF]]
+; ISC99-NEXT: [[ACOSHF:%.*]] = call fast float @acoshf(float [[F:%.*]])
+; ISC99-NEXT: ret float [[ACOSHF]]
+; ISC89: [[ACOSHF:%.*]] = call fast double @acosh(double [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @acosh(double %conv)
@@ -56,8 +59,10 @@ define double @acosh_test2(float %f) {
define float @asin_test1(float %f) {
; CHECK-LABEL: @asin_test1(
-; CHECK-NEXT: [[ASINF:%.*]] = call fast float @asinf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[ASINF]]
+; LINUX-NEXT: [[ASINF:%.*]] = call fast float @asinf(float [[F:%.*]])
+; LINUX-NEXT: ret float [[ASINF]]
+; MS32: [[ASINF:%.*]] = call fast double @asin(double [[F:%.*]])
+; MS64-NEXT: [[ASINF:%.*]] = call fast float @asinf(float [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @asin(double %conv)
@@ -78,8 +83,9 @@ define double @asin_test2(float %f) {
define float @asinh_test1(float %f) {
; CHECK-LABEL: @asinh_test1(
-; CHECK-NEXT: [[ASINHF:%.*]] = call fast float @asinhf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[ASINHF]]
+; ISC99-NEXT: [[ASINHF:%.*]] = call fast float @asinhf(float [[F:%.*]])
+; ISC99-NEXT: ret float [[ASINHF]]
+; ISC89: [[ASINHF:%.*]] = call fast double @asinh(double [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @asinh(double %conv)
@@ -100,8 +106,10 @@ define double @asinh_test2(float %f) {
define float @atan_test1(float %f) {
; CHECK-LABEL: @atan_test1(
-; CHECK-NEXT: [[ATANF:%.*]] = call fast float @atanf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[ATANF]]
+; LINUX-NEXT: [[ATANF:%.*]] = call fast float @atanf(float [[F:%.*]])
+; LINUX-NEXT: ret float [[ATANF]]
+; MS32: [[ATANF:%.*]] = call fast double @atan(double [[F:%.*]])
+; MS64-NEXT: [[ATANF:%.*]] = call fast float @atanf(float [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @atan(double %conv)
@@ -122,8 +130,9 @@ define double @atan_test2(float %f) {
define float @atanh_test1(float %f) {
; CHECK-LABEL: @atanh_test1(
-; CHECK-NEXT: [[ATANHF:%.*]] = call fast float @atanhf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[ATANHF]]
+; ISC99-NEXT: [[ATANHF:%.*]] = call fast float @atanhf(float [[F:%.*]])
+; ISC99-NEXT: ret float [[ATANHF]]
+; ISC89: [[ATANHF:%.*]] = call fast double @atanh(double [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @atanh(double %conv)
@@ -144,8 +153,9 @@ define double @atanh_test2(float %f) {
define float @cbrt_test1(float %f) {
; CHECK-LABEL: @cbrt_test1(
-; CHECK-NEXT: [[CBRTF:%.*]] = call fast float @cbrtf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[CBRTF]]
+; ISC99-NEXT: [[CBRTF:%.*]] = call fast float @cbrtf(float [[F:%.*]])
+; ISC99-NEXT: ret float [[CBRTF]]
+; ISC89: [[CBRTF:%.*]] = call fast double @cbrt(double [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @cbrt(double %conv)
@@ -166,8 +176,10 @@ define double @cbrt_test2(float %f) {
define float @exp_test1(float %f) {
; CHECK-LABEL: @exp_test1(
-; CHECK-NEXT: [[EXPF:%.*]] = call fast float @expf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[EXPF]]
+; LINUX-NEXT: [[EXPF:%.*]] = call fast float @expf(float [[F:%.*]])
+; LINUX-NEXT: ret float [[EXPF]]
+; MS32: [[EXPF:%.*]] = call fast double @exp(double [[F:%.*]])
+; MS64-NEXT: [[EXPF:%.*]] = call fast float @expf(float [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @exp(double %conv)
@@ -188,8 +200,9 @@ define double @exp_test2(float %f) {
define float @expm1_test1(float %f) {
; CHECK-LABEL: @expm1_test1(
-; CHECK-NEXT: [[EXPM1F:%.*]] = call fast float @expm1f(float [[F:%.*]])
-; CHECK-NEXT: ret float [[EXPM1F]]
+; ISC99-NEXT: [[EXPM1F:%.*]] = call fast float @expm1f(float [[F:%.*]])
+; ISC99-NEXT: ret float [[EXPM1F]]
+; ISC89: [[EXPM1F:%.*]] = call fast double @expm1(double [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @expm1(double %conv)
@@ -236,8 +249,10 @@ define double @exp10_test2(float %f) {
define float @log_test1(float %f) {
; CHECK-LABEL: @log_test1(
-; CHECK-NEXT: [[LOGF:%.*]] = call fast float @logf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[LOGF]]
+; LINUX-NEXT: [[LOGF:%.*]] = call fast float @logf(float [[F:%.*]])
+; LINUX-NEXT: ret float [[LOGF]]
+; MS32: [[LOGF:%.*]] = call fast double @log(double [[F:%.*]])
+; MS64-NEXT: [[LOGF:%.*]] = call fast float @logf(float [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @log(double %conv)
@@ -258,8 +273,10 @@ define double @log_test2(float %f) {
define float @log10_test1(float %f) {
; CHECK-LABEL: @log10_test1(
-; CHECK-NEXT: [[LOG10F:%.*]] = call fast float @log10f(float [[F:%.*]])
-; CHECK-NEXT: ret float [[LOG10F]]
+; LINUX-NEXT: [[LOG10F:%.*]] = call fast float @log10f(float [[F:%.*]])
+; LINUX-NEXT: ret float [[LOG10F]]
+; MS32: [[LOG10F:%.*]] = call fast double @log10(double [[F:%.*]])
+; MS64-NEXT: [[LOG10F:%.*]] = call fast float @log10f(float [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @log10(double %conv)
@@ -280,8 +297,9 @@ define double @log10_test2(float %f) {
define float @log1p_test1(float %f) {
; CHECK-LABEL: @log1p_test1(
-; CHECK-NEXT: [[LOG1PF:%.*]] = call fast float @log1pf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[LOG1PF]]
+; ISC99-NEXT: [[LOG1PF:%.*]] = call fast float @log1pf(float [[F:%.*]])
+; ISC99-NEXT: ret float [[LOG1PF]]
+; ISC89: [[LOG1PF:%.*]] = call fast double @log1p(double [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @log1p(double %conv)
@@ -302,8 +320,9 @@ define double @log1p_test2(float %f) {
define float @log2_test1(float %f) {
; CHECK-LABEL: @log2_test1(
-; CHECK-NEXT: [[LOG2F:%.*]] = call fast float @log2f(float [[F:%.*]])
-; CHECK-NEXT: ret float [[LOG2F]]
+; ISC99-NEXT: [[LOG2F:%.*]] = call fast float @log2f(float [[F:%.*]])
+; ISC99-NEXT: ret float [[LOG2F]]
+; ISC89: [[LOG2F:%.*]] = call fast double @log2(double [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @log2(double %conv)
@@ -324,8 +343,10 @@ define double @log2_test2(float %f) {
define float @logb_test1(float %f) {
; CHECK-LABEL: @logb_test1(
-; CHECK-NEXT: [[LOGBF:%.*]] = call fast float @logbf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[LOGBF]]
+; LINUX-NEXT: [[LOGBF:%.*]] = call fast float @logbf(float [[F:%.*]])
+; LINUX-NEXT: ret float [[LOGBF]]
+; MS32: [[POWF:%.*]] = call fast double @logb(double [[F:%.*]])
+; MS64-NEXT: [[LOGBF:%.*]] = call fast float @logbf(float [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @logb(double %conv)
@@ -346,8 +367,10 @@ define double @logb_test2(float %f) {
define float @pow_test1(float %f, float %g) {
; CHECK-LABEL: @pow_test1(
-; CHECK-NEXT: [[POWF:%.*]] = call fast float @powf(float %f, float %g)
-; CHECK-NEXT: ret float [[POWF]]
+; LINUX-NEXT: [[POWF:%.*]] = call fast float @powf(float %f, float %g)
+; LINUX-NEXT: ret float [[POWF]]
+; MS32: [[POWF:%.*]] = call fast double @pow(double %df, double %dg)
+; MS64-NEXT: [[POWF:%.*]] = call fast float @powf(float %f, float %g)
;
%df = fpext float %f to double
%dg = fpext float %g to double
@@ -369,8 +392,10 @@ define double @pow_test2(float %f, float %g) {
define float @sin_test1(float %f) {
; CHECK-LABEL: @sin_test1(
-; CHECK-NEXT: [[SINF:%.*]] = call fast float @sinf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[SINF]]
+; LINUX-NEXT: [[SINF:%.*]] = call fast float @sinf(float [[F:%.*]])
+; LINUX-NEXT: ret float [[SINF]]
+; MS32: [[SINF:%.*]] = call fast double @sin(double [[F:%.*]])
+; MS64-NEXT: [[SINF:%.*]] = call fast float @sinf(float [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @sin(double %conv)
@@ -391,8 +416,10 @@ define double @sin_test2(float %f) {
define float @sqrt_test1(float %f) {
; CHECK-LABEL: @sqrt_test1(
-; CHECK-NEXT: [[SQRTF:%.*]] = call float @sqrtf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[SQRTF]]
+; LINUX-NEXT: [[SQRTF:%.*]] = call float @sqrtf(float [[F:%.*]])
+; LINUX-NEXT: ret float [[SQRTF]]
+; MS32: [[SQRTF:%.*]] = call double @sqrt(double [[F:%.*]])
+; MS64-NEXT: [[SQRTF:%.*]] = call float @sqrtf(float [[F:%.*]])
;
%conv = fpext float %f to double
%call = call double @sqrt(double %conv)
@@ -413,8 +440,10 @@ define double @sqrt_test2(float %f) {
define float @sqrt_int_test1(float %f) {
; CHECK-LABEL: @sqrt_int_test1(
-; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.sqrt.f32(float [[F:%.*]])
-; CHECK-NEXT: ret float [[TMP1]]
+; LINUX-NEXT: [[TMP1:%.*]] = call float @llvm.sqrt.f32(float [[F:%.*]])
+; LINUX-NEXT: ret float [[TMP1]]
+; MS32: [[TMP1:%.*]] = call double @llvm.sqrt.f64(double [[F:%.*]])
+; MS64-NEXT: [[TMP1:%.*]] = call float @llvm.sqrt.f32(float [[F:%.*]])
;
%conv = fpext float %f to double
%call = call double @llvm.sqrt.f64(double %conv)
@@ -435,8 +464,10 @@ define double @sqrt_int_test2(float %f) {
define float @tan_test1(float %f) {
; CHECK-LABEL: @tan_test1(
-; CHECK-NEXT: [[TANF:%.*]] = call fast float @tanf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[TANF]]
+; LINUX-NEXT: [[TANF:%.*]] = call fast float @tanf(float [[F:%.*]])
+; LINUX-NEXT: ret float [[TANF]]
+; MS32: [[TANF:%.*]] = call fast double @tan(double [[F:%.*]])
+; MS64-NEXT: [[TANF:%.*]] = call fast float @tanf(float [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @tan(double %conv)
@@ -456,8 +487,10 @@ define double @tan_test2(float %f) {
}
define float @tanh_test1(float %f) {
; CHECK-LABEL: @tanh_test1(
-; CHECK-NEXT: [[TANHF:%.*]] = call fast float @tanhf(float [[F:%.*]])
-; CHECK-NEXT: ret float [[TANHF]]
+; LINUX-NEXT: [[TANHF:%.*]] = call fast float @tanhf(float [[F:%.*]])
+; LINUX-NEXT: ret float [[TANHF]]
+; MS32: [[TANHF:%.*]] = call fast double @tanh(double [[F:%.*]])
+; MS64-NEXT: [[TANHF:%.*]] = call fast float @tanhf(float [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @tanh(double %conv)
@@ -480,8 +513,9 @@ define double @tanh_test2(float %f) {
; flags are propagated for shrunken *binary* double FP calls.
define float @max1(float %a, float %b) {
; CHECK-LABEL: @max1(
-; CHECK-NEXT: [[FMAXF:%.*]] = call arcp float @fmaxf(float [[A:%.*]], float [[B:%.*]])
-; CHECK-NEXT: ret float [[FMAXF]]
+; ISC99-NEXT: [[FMAXF:%.*]] = call arcp float @fmaxf(float [[A:%.*]], float [[B:%.*]])
+; ISC99-NEXT: ret float [[FMAXF]]
+; ISC89: [[FMAXF:%.*]] = call arcp double @fmax(double [[A:%.*]], double [[B:%.*]])
;
%c = fpext float %a to double
%d = fpext float %b to double