forked from OSchip/llvm-project
[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:
parent
b30c50c8fa
commit
0ea9d1e753
|
@ -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 |
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue