summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorEvandro Menezes <e.menezes@samsung.com>2019-02-04 23:34:50 +0000
committerEvandro Menezes <e.menezes@samsung.com>2019-02-04 23:34:50 +0000
commit98f356cd74ad9c2323c3dabd28f5d58fb6151adb (patch)
tree10812ec2938ea507c053cd8527322634d133f43e /llvm/test/Transforms/InstCombine
parentd016763774199214287ea4b778ab9d077e087dfc (diff)
downloadbcm5719-llvm-98f356cd74ad9c2323c3dabd28f5d58fb6151adb.tar.gz
bcm5719-llvm-98f356cd74ad9c2323c3dabd28f5d58fb6151adb.zip
Revert "[PATCH] [TargetLibraryInfo] Update run time support for Windows"
This reverts accidental commit ff5527718d5d3b9966f6e8948866c0dc15ffcf3c. llvm-svn: 353118
Diffstat (limited to 'llvm/test/Transforms/InstCombine')
-rw-r--r--llvm/test/Transforms/InstCombine/double-float-shrink-1.ll12
-rw-r--r--llvm/test/Transforms/InstCombine/double-float-shrink-2.ll57
-rw-r--r--llvm/test/Transforms/InstCombine/pow-1.ll16
-rw-r--r--llvm/test/Transforms/InstCombine/win-math.ll37
4 files changed, 73 insertions, 49 deletions
diff --git a/llvm/test/Transforms/InstCombine/double-float-shrink-1.ll b/llvm/test/Transforms/InstCombine/double-float-shrink-1.ll
index 84af12d629e..e3dc6bb54ed 100644
--- a/llvm/test/Transforms/InstCombine/double-float-shrink-1.ll
+++ b/llvm/test/Transforms/InstCombine/double-float-shrink-1.ll
@@ -335,9 +335,9 @@ define double @log2_test2(float %f) {
define float @logb_test1(float %f) {
; CHECK-LABEL: @logb_test1(
-; LIN64-NEXT: [[LOGBF:%.*]] = call fast float @logbf(float [[F:%.*]])
-; LIN64-NEXT: ret float [[LOGBF]]
-; WIN32: [[LOGBF:%.*]] = call fast double @logb(double [[F:%.*]])
+; LINUX-NEXT: [[LOGBF:%.*]] = call fast float @logbf(float [[F:%.*]])
+; LINUX-NEXT: ret float [[LOGBF]]
+; WIN96: [[LOGBF:%.*]] = call fast double @logb(double [[F:%.*]])
;
%conv = fpext float %f to double
%call = call fast double @logb(double %conv)
@@ -498,9 +498,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(
-; LINUX-NEXT: [[FMAXF:%.*]] = call arcp float @fmaxf(float [[A:%.*]], float [[B:%.*]])
-; LINUX-NEXT: ret float [[FMAXF]]
-; WIN96: [[FMAXF:%.*]] = call arcp double @fmax(double [[A:%.*]], double [[B:%.*]])
+; LIN64-NEXT: [[FMAXF:%.*]] = call arcp float @fmaxf(float [[A:%.*]], float [[B:%.*]])
+; LIN64-NEXT: ret float [[FMAXF]]
+; WIN32: [[FMAXF:%.*]] = call arcp double @fmax(double [[A:%.*]], double [[B:%.*]])
;
%c = fpext float %a to double
%d = fpext float %b to double
diff --git a/llvm/test/Transforms/InstCombine/double-float-shrink-2.ll b/llvm/test/Transforms/InstCombine/double-float-shrink-2.ll
index 76e497bd68f..d5099531af9 100644
--- a/llvm/test/Transforms/InstCombine/double-float-shrink-2.ll
+++ b/llvm/test/Transforms/InstCombine/double-float-shrink-2.ll
@@ -1,10 +1,10 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt < %s -instcombine -S -mtriple "i386-pc-linux" | FileCheck %s
-; RUN: opt < %s -instcombine -S -mtriple "i386-pc-win32" | FileCheck %s
-; RUN: opt < %s -instcombine -S -mtriple "x86_64-pc-win32" | FileCheck %s
-; RUN: opt < %s -instcombine -S -mtriple "i386-pc-mingw32" | FileCheck %s
-; RUN: opt < %s -instcombine -S -mtriple "x86_64-pc-mingw32" | FileCheck %s
-; RUN: opt < %s -instcombine -S -mtriple "sparc-sun-solaris" | FileCheck %s
+; RUN: opt < %s -instcombine -S -mtriple "i386-pc-linux" | FileCheck --check-prefixes=CHECK,DO-SIMPLIFY %s
+; RUN: opt < %s -instcombine -S -mtriple "i386-pc-win32" | FileCheck --check-prefixes=CHECK,DONT-SIMPLIFY %s
+; RUN: opt < %s -instcombine -S -mtriple "x86_64-pc-win32" | FileCheck --check-prefixes=CHECK,C89-SIMPLIFY %s
+; RUN: opt < %s -instcombine -S -mtriple "i386-pc-mingw32" | FileCheck --check-prefixes=CHECK,DO-SIMPLIFY %s
+; RUN: opt < %s -instcombine -S -mtriple "x86_64-pc-mingw32" | FileCheck --check-prefixes=CHECK,DO-SIMPLIFY %s
+; RUN: opt < %s -instcombine -S -mtriple "sparc-sun-solaris" | FileCheck --check-prefixes=CHECK,DO-SIMPLIFY %s
; RUN: opt < %s -instcombine -S -mtriple "x86_64-pc-win32" -enable-debugify 2>&1 | FileCheck --check-prefix=DBG-VALID %s
declare double @floor(double)
@@ -61,8 +61,19 @@ define float @test_shrink_libcall_ceil(float %C) {
define float @test_shrink_libcall_round(float %C) {
; CHECK-LABEL: @test_shrink_libcall_round(
-; CHECK-NEXT: [[F:%.*]] = call float @llvm.round.f32(float [[C:%.*]])
-; CHECK-NEXT: ret float [[F]]
+
+; DO-SIMPLIFY-NEXT: [[F:%.*]] = call float @llvm.round.f32(float [[C:%.*]])
+; DO-SIMPLIFY-NEXT: ret float [[F]]
+;
+; DONT-SIMPLIFY-NEXT: [[D:%.*]] = fpext float [[C:%.*]] to double
+; DONT-SIMPLIFY-NEXT: [[E:%.*]] = call double @round(double [[D]])
+; DONT-SIMPLIFY-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
+; DONT-SIMPLIFY-NEXT: ret float [[F]]
+;
+; C89-SIMPLIFY-NEXT: [[D:%.*]] = fpext float [[C:%.*]] to double
+; C89-SIMPLIFY-NEXT: [[E:%.*]] = call double @round(double [[D]])
+; C89-SIMPLIFY-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
+; C89-SIMPLIFY-NEXT: ret float [[F]]
;
%D = fpext float %C to double
; --> roundf
@@ -73,8 +84,19 @@ define float @test_shrink_libcall_round(float %C) {
define float @test_shrink_libcall_nearbyint(float %C) {
; CHECK-LABEL: @test_shrink_libcall_nearbyint(
-; CHECK-NEXT: [[F:%.*]] = call float @llvm.nearbyint.f32(float [[C:%.*]])
-; CHECK-NEXT: ret float [[F]]
+
+; DO-SIMPLIFY-NEXT: [[F:%.*]] = call float @llvm.nearbyint.f32(float [[C:%.*]])
+; DO-SIMPLIFY-NEXT: ret float [[F]]
+;
+; DONT-SIMPLIFY-NEXT: [[D:%.*]] = fpext float [[C:%.*]] to double
+; DONT-SIMPLIFY-NEXT: [[E:%.*]] = call double @nearbyint(double [[D]])
+; DONT-SIMPLIFY-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
+; DONT-SIMPLIFY-NEXT: ret float [[F]]
+;
+; C89-SIMPLIFY-NEXT: [[D:%.*]] = fpext float [[C:%.*]] to double
+; C89-SIMPLIFY-NEXT: [[E:%.*]] = call double @nearbyint(double [[D]])
+; C89-SIMPLIFY-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
+; C89-SIMPLIFY-NEXT: ret float [[F]]
;
%D = fpext float %C to double
; --> nearbyintf
@@ -85,8 +107,19 @@ define float @test_shrink_libcall_nearbyint(float %C) {
define float @test_shrink_libcall_trunc(float %C) {
; CHECK-LABEL: @test_shrink_libcall_trunc(
-; CHECK-NEXT: [[F:%.*]] = call float @llvm.trunc.f32(float [[C:%.*]])
-; CHECK-NEXT: ret float [[F]]
+
+; DO-SIMPLIFY-NEXT: [[F:%.*]] = call float @llvm.trunc.f32(float [[C:%.*]])
+; DO-SIMPLIFY-NEXT: ret float [[F]]
+;
+; DONT-SIMPLIFY-NEXT: [[D:%.*]] = fpext float [[C:%.*]] to double
+; DONT-SIMPLIFY-NEXT: [[E:%.*]] = call double @trunc(double [[D]])
+; DONT-SIMPLIFY-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
+; DONT-SIMPLIFY-NEXT: ret float [[F]]
+;
+; C89-SIMPLIFY-NEXT: [[D:%.*]] = fpext float [[C:%.*]] to double
+; C89-SIMPLIFY-NEXT: [[E:%.*]] = call double @trunc(double [[D]])
+; C89-SIMPLIFY-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
+; C89-SIMPLIFY-NEXT: ret float [[F]]
;
%D = fpext float %C to double
; --> truncf
diff --git a/llvm/test/Transforms/InstCombine/pow-1.ll b/llvm/test/Transforms/InstCombine/pow-1.ll
index 868450cd150..85f61b886c5 100644
--- a/llvm/test/Transforms/InstCombine/pow-1.ll
+++ b/llvm/test/Transforms/InstCombine/pow-1.ll
@@ -73,9 +73,11 @@ define float @test_simplify3(float %x) {
define double @test_simplify3n(double %x) {
; CHECK-LABEL: @test_simplify3n(
-; CHECK-NEXT: [[MUL:%.*]] = fmul double [[X:%.*]], -2.000000e+00
-; CHECK-NEXT: [[EXP2:%.*]] = call double @exp2(double [[MUL]]) [[NUW_RO:#[0-9]+]]
-; CHECK-NEXT: ret double [[EXP2]]
+; ANY-NEXT: [[MUL:%.*]] = fmul double [[X:%.*]], -2.000000e+00
+; ANY-NEXT: [[EXP2:%.*]] = call double @exp2(double [[MUL]]) [[NUW_RO]]
+; ANY-NEXT: ret double [[EXP2]]
+; WIN-NEXT: [[POW:%.*]] = call double @pow(double 2.500000e-01, double [[X:%.*]])
+; WIN-NEXT: ret double [[POW]]
;
%retval = call double @pow(double 0.25, double %x)
ret double %retval
@@ -106,8 +108,10 @@ define <2 x double> @test_simplify3vn(<2 x double> %x) {
define double @test_simplify4(double %x) {
; CHECK-LABEL: @test_simplify4(
-; CHECK-NEXT: [[EXP2:%.*]] = call double @exp2(double [[X:%.*]]) [[NUW_RO]]
-; CHECK-NEXT: ret double [[EXP2]]
+; ANY-NEXT: [[EXP2:%.*]] = call double @exp2(double [[X:%.*]]) [[NUW_RO]]
+; ANY-NEXT: ret double [[EXP2]]
+; WIN-NEXT: [[POW:%.*]] = call double @pow(double 2.000000e+00, double [[X:%.*]])
+; WIN-NEXT: ret double [[POW]]
;
%retval = call double @pow(double 2.0, double %x)
ret double %retval
@@ -191,7 +195,7 @@ define <2 x double> @test_simplify6v(<2 x double> %x) {
define float @test_simplify7(float %x) {
; CHECK-LABEL: @test_simplify7(
; ANY-NEXT: [[SQRTF:%.*]] = call float @sqrtf(float [[X:%.*]]) [[NUW_RO]]
-; WIN-NEXT: [[SQRTF:%.*]] = call float @sqrtf(float [[X:%.*]]) [[NUW_RO]]
+; WIN-NEXT: [[SQRTF:%.*]] = call float @sqrtf(float [[X:%.*]]) [[NUW_RO:#[0-9]+]]
; CHECK-NEXT: [[ABS:%.*]] = call float @llvm.fabs.f32(float [[SQRTF]])
; CHECK-NEXT: [[ISINF:%.*]] = fcmp oeq float [[X]], 0xFFF0000000000000
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[ISINF]], float 0x7FF0000000000000, float [[ABS]]
diff --git a/llvm/test/Transforms/InstCombine/win-math.ll b/llvm/test/Transforms/InstCombine/win-math.ll
index e305596050a..4f774e5f6d5 100644
--- a/llvm/test/Transforms/InstCombine/win-math.ll
+++ b/llvm/test/Transforms/InstCombine/win-math.ll
@@ -1,11 +1,11 @@
-; RUN: opt < %s -O2 -S -mtriple=i386-pc-win32 | FileCheck %s --check-prefixes=CHECK,WIN32
-; RUN: opt < %s -O2 -S -mtriple=x86_64-pc-win32 | FileCheck %s --check-prefixes=CHECK,WIN64
-; RUN: opt < %s -O2 -S -mtriple=i386-pc-mingw32 | FileCheck %s --check-prefixes=CHECK,MINGW32
-; RUN: opt < %s -O2 -S -mtriple=x86_64-pc-mingw32 | FileCheck %s --check-prefixes=CHECK,MINGW64
+; RUN: opt -O2 -S -mtriple=i386-pc-win32 < %s | FileCheck %s --check-prefixes=CHECK,WIN32
+; RUN: opt -O2 -S -mtriple=x86_64-pc-win32 < %s | FileCheck %s --check-prefixes=CHECK,WIN64
+; RUN: opt -O2 -S -mtriple=i386-pc-mingw32 < %s | FileCheck %s --check-prefixes=CHECK,MINGW32
+; RUN: opt -O2 -S -mtriple=x86_64-pc-mingw32 < %s | FileCheck %s --check-prefixes=CHECK,MINGW64
; x86 win32 msvcrt does not provide entry points for single-precision libm.
-; x86-64 win32 msvcrt does, but with exceptions
-; msvcrt does not provide all of C99 math, but mingw32 does.
+; x86-64 win32 msvcrt does (except for fabsf)
+; msvcrt does not provide C99 math, but mingw32 does.
declare double @acos(double %x)
define float @float_acos(float %x) nounwind readnone {
@@ -188,19 +188,6 @@ define float @float_log(float %x) nounwind readnone {
ret float %3
}
-declare double @logb(double %x)
-define float @float_logb(float %x) nounwind readnone {
-; CHECK-LABEL: @float_logb(
-; WIN32-NOT: float @logbf
-; WIN32: double @logb
-; WIN64-NOT: float @logbf
-; WIN64: double @logb
- %1 = fpext float %x to double
- %2 = call double @logb(double %1)
- %3 = fptrunc double %2 to float
- ret float %3
-}
-
declare double @pow(double %x, double %y)
define float @float_pow(float %x, float %y) nounwind readnone {
; CHECK-LABEL: @float_pow(
@@ -284,14 +271,14 @@ define float @float_tanh(float %x) nounwind readnone {
ret float %3
}
-; win32 does not have roundf; mingw32 does
+; win32 does not have round; mingw32 does
declare double @round(double %x)
define float @float_round(float %x) nounwind readnone {
; CHECK-LABEL: @float_round(
-; WIN32-NOT: double @round
-; WIN32: float @llvm.round.f32
-; WIN64-NOT: double @round
-; WIN64: float @llvm.round.f32
+; WIN32-NOT: float @roundf
+; WIN32: double @round
+; WIN64-NOT: float @roundf
+; WIN64: double @round
; MINGW32-NOT: double @round
; MINGW32: float @llvm.round.f32
; MINGW64-NOT: double @round
@@ -304,7 +291,7 @@ define float @float_round(float %x) nounwind readnone {
declare float @powf(float, float)
-; win32 lacks sqrtf & fabsf, win64 lacks fabsf, but
+; win32 lacks sqrtf&fabsf, win64 lacks fabsf, but
; calls to the intrinsics can be emitted instead.
define float @float_powsqrt(float %x) nounwind readnone {
; CHECK-LABEL: @float_powsqrt(
OpenPOWER on IntegriCloud