summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/fpcast.ll
diff options
context:
space:
mode:
authorAhmed Bougacha <ahmed.bougacha@gmail.com>2015-05-29 00:04:30 +0000
committerAhmed Bougacha <ahmed.bougacha@gmail.com>2015-05-29 00:04:30 +0000
commit0ea9d1e7531e2ba74691c5e0836b224c95c0ac95 (patch)
treeda39a610ba8235b7dfac3fe6520106a5563ce795 /llvm/test/Transforms/InstCombine/fpcast.ll
parentb30c50c8fae80824ea0afe1e17a94f54e21151c9 (diff)
downloadbcm5719-llvm-0ea9d1e7531e2ba74691c5e0836b224c95c0ac95.tar.gz
bcm5719-llvm-0ea9d1e7531e2ba74691c5e0836b224c95c0ac95.zip
[IR] fptrunc-of-fptrunc isn't an EliminableCastPair.
Double and single rounding can produce different results. This is the IR counterpart to r228911. llvm-svn: 238531
Diffstat (limited to 'llvm/test/Transforms/InstCombine/fpcast.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/fpcast.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/fpcast.ll b/llvm/test/Transforms/InstCombine/fpcast.ll
index 8319624b87c..93a64e6b49b 100644
--- a/llvm/test/Transforms/InstCombine/fpcast.ll
+++ b/llvm/test/Transforms/InstCombine/fpcast.ll
@@ -85,3 +85,11 @@ define float @test8(float %V) {
; CHECK-NEXT: %[[trunc:.*]] = fptrunc double %frem to float
; CHECK-NEXT: ret float %trunc
}
+
+; CHECK-LABEL: @test_fptrunc_fptrunc
+; CHECK-NOT: fptrunc double {{.*}} to half
+define half @test_fptrunc_fptrunc(double %V) {
+ %t1 = fptrunc double %V to float
+ %t2 = fptrunc float %t1 to half
+ ret half %t2
+}
OpenPOWER on IntegriCloud