[InstCombine] Preserve fast math flags when combining PHIs
authorSilviu Baranga <silviu.baranga@arm.com>
Fri, 22 Apr 2016 11:21:36 +0000 (11:21 +0000)
committerSilviu Baranga <silviu.baranga@arm.com>
Fri, 22 Apr 2016 11:21:36 +0000 (11:21 +0000)
commite985c76b905129cf083d0894694eaef3362a2555
tree6832f09d3cffa479ea56ec3f8d8165feec4bc083
parent55609982503543eefc7347273e71290fe5d14ebf
[InstCombine] Preserve fast math flags when combining PHIs

Summary:
When optimizing PHIs which have inputs floating point binary
operators, we preserve all IR flags except the fast math
flags.

This change removes the logic which tracked some of the IR flags
(no wrap, exact) and replaces it by doing an and on the IR flags of
all inputs to the PHI - which will also handle the fast math
flags.

Reviewers: majnemer

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D19370

llvm-svn: 267139
llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
llvm/test/Transforms/InstCombine/phi-preserve-ir-flags.ll [new file with mode: 0644]