]> granicus.if.org Git - llvm/commit
[InstCombine] fadd double (sitofp x), y check that the promotion is valid
authorArtur Pilipenko <apilipenko@azulsystems.com>
Fri, 21 Apr 2017 18:45:25 +0000 (18:45 +0000)
committerArtur Pilipenko <apilipenko@azulsystems.com>
Fri, 21 Apr 2017 18:45:25 +0000 (18:45 +0000)
commitbbc50e81b0fcd98fb169f10716dc2e1f068506be
treef13fc81bc1deee3085cf118accbb73b2c11f8519
parent768a04e3df29dd583fee466bbc0ddbeb8ded9479
[InstCombine] fadd double (sitofp x), y check that the promotion is valid

Doing these transformations check that the result of integer addition is representable in the FP type.

(fadd double (sitofp x), fpcst) --> (sitofp (add int x, intcst))
(fadd double (sitofp x), (sitofp y)) --> (sitofp (add int x, y))

This is a fix for https://bugs.llvm.org//show_bug.cgi?id=27036

Reviewed By: andrew.w.kaylor, scanon, spatel

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301018 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAddSub.cpp
test/Transforms/InstCombine/add-sitofp.ll