[PATCH] D44038: [InstCombine] Rewrite the binary op shrinking in visitFPTrunc to avoid creating overly small ConstantFPs that we'll just need to extend again.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 2 11:45:54 PST 2018


craig.topper created this revision.
craig.topper added reviewers: spatel, scanon.

Instead of returning the smaller FP constant we now return the minimal Type the constant can fit into. We also return the Type of the input to any fp extends. The legality checks are then done on just the size of these Types. If we find something profitable we then emit FPTruncs in front of the smaller binop and assume those FPTruncs will be constant folded or combined with any ConstantFPs or fpextends.


https://reviews.llvm.org/D44038

Files:
  lib/Transforms/InstCombine/InstCombineCasts.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44038.136819.patch
Type: text/x-patch
Size: 7790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180302/7415f8bb/attachment.bin>


More information about the llvm-commits mailing list