1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[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
This commit is contained in:
Ahmed Bougacha 2015-05-29 00:04:30 +00:00
parent ab15095964
commit a689d2cb58
2 changed files with 9 additions and 1 deletions

View File

@ -2120,7 +2120,7 @@ unsigned CastInst::isEliminableCastPair(
{ 0, 0, 0,99,99, 0, 0,99,99,99, 0, 3, 0}, // FPToSI |
{ 99,99,99, 0, 0,99,99, 0, 0,99,99, 4, 0}, // UIToFP +- firstOp
{ 99,99,99, 0, 0,99,99, 0, 0,99,99, 4, 0}, // SIToFP |
{ 99,99,99, 0, 0,99,99, 1, 0,99,99, 4, 0}, // FPTrunc |
{ 99,99,99, 0, 0,99,99, 0, 0,99,99, 4, 0}, // FPTrunc |
{ 99,99,99, 2, 2,99,99,10, 2,99,99, 4, 0}, // FPExt |
{ 1, 0, 0,99,99, 0, 0,99,99,99, 7, 3, 0}, // PtrToInt |
{ 99,99,99,99,99,99,99,99,99,11,99,15, 0}, // IntToPtr |

View File

@ -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
}