[all-commits] [llvm/llvm-project] a62533: [InstCombine] fold fpext into exact integer-to-FP ...

RotateRight via All-commits all-commits at lists.llvm.org
Sun May 10 04:09:58 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a62533c29f842ba39c6e47a09b59bb0ae2dcc31b
      https://github.com/llvm/llvm-project/commit/a62533c29f842ba39c6e47a09b59bb0ae2dcc31b
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-05-10 (Sun, 10 May 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
    M llvm/test/Transforms/InstCombine/fpextend.ll

  Log Message:
  -----------
  [InstCombine] fold fpext into exact integer-to-FP cast

We can combine a floating-point extension cast with a conversion
from integer if we know the earlier cast is exact.

This is an optimization suggested in PR36617:
https://bugs.llvm.org/show_bug.cgi?id=36617#c19

However, this patch does not change the example suggested there.
This patch only uses the existing analysis to handle cases where
the integer source value magnitude is narrower than the
intermediate FP mantissa (guarantees that the conversion to FP is
exact). Follow-up patches to the analysis function can enable
more cases.

Differential Revision: https://reviews.llvm.org/D79116




More information about the All-commits mailing list