OSDN Git Service

[InstCombine] improve analysis of FP->int->FP to eliminate fpextend
authorSanjay Patel <spatel@rotateright.com>
Sun, 17 May 2020 12:43:40 +0000 (08:43 -0400)
committerSanjay Patel <spatel@rotateright.com>
Sun, 17 May 2020 13:06:57 +0000 (09:06 -0400)
commitbfd512160fe091bdd45199e5db884a24cd9d5f59
tree2304608b5259c8a489368133b2cee5f6ccb10d5e
parentb54a6633128f987b94869059ae85e922d4ed14a0
[InstCombine] improve analysis of FP->int->FP to eliminate fpextend

This was originally in D79116.
Converting from a narrow-enough FP source value to integer and
back to FP guarantees that the conversion to FP is exact because
of UB/poison-on-overflow.

This was suggested in PR36617:
https://bugs.llvm.org/show_bug.cgi?id=36617#c19
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
llvm/test/Transforms/InstCombine/fpextend.ll