From 0ea9d1e7531e2ba74691c5e0836b224c95c0ac95 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Fri, 29 May 2015 00:04:30 +0000 Subject: [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 --- llvm/test/Transforms/InstCombine/fpcast.ll | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'llvm/test/Transforms/InstCombine/fpcast.ll') 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 +} -- cgit v1.2.3