[InstCombine] fold FP trunc into exact itofp
authorSanjay Patel <spatel@rotateright.com>
Sun, 24 May 2020 13:30:19 +0000 (09:30 -0400)
committerSanjay Patel <spatel@rotateright.com>
Sun, 24 May 2020 13:30:19 +0000 (09:30 -0400)
commitc048a02b5b26c21a2a891131e3d52c7ddbc3cf62
treef5b63795194779084d32710375fa4c4809eaa32a
parent7eed772a279e8cd45eee70cab2cfa71f71cc90c8
[InstCombine] fold FP trunc into exact itofp

Similar to D79116 and rGbfd512160fe0 - if the 1st cast
is exact, then we can go directly to the destination
type because there is no double-rounding.
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
llvm/test/Transforms/InstCombine/fptrunc.ll