OSDN Git Service

[InstCombine] Allow fptrunc (fpext X)) to be reduced to a single fpext/ftrunc
authorCraig Topper <craig.topper@intel.com>
Fri, 2 Mar 2018 18:16:51 +0000 (18:16 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 2 Mar 2018 18:16:51 +0000 (18:16 +0000)
commit5391b3c8a021e0bff10f1db3f3aeaedee27e46e6
treeb952e09bafa67ecd630d3541a83fb430837601ab
parent442f953b4e275844d4d2a244f2feca5fb8a77805
[InstCombine] Allow fptrunc (fpext X)) to be reduced to a single fpext/ftrunc

If we are only truncating bits from the extend we should be able to just use a smaller extend.

If we are truncating more than the extend we should be able to just use a fptrunc since the presense of the fpextend shouldn't affect rounding.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326595 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/Instructions.cpp
test/Transforms/InstCombine/double-float-shrink-2.ll
test/Transforms/InstCombine/fpextend.ll