[GVN] don't propagate equality comparisons of FP zero (PR22376)
authorSanjay Patel <spatel@rotateright.com>
Thu, 29 Jan 2015 20:51:49 +0000 (20:51 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 29 Jan 2015 20:51:49 +0000 (20:51 +0000)
commit26c81cc87025d2c86e5d28c3dbf17e510c459ea6
tree3071b375b85e24831556f58ff4ccbe1647ed0a53
parent1b7b2597d5e9612795b14d50428d69e368b89d7a
[GVN] don't propagate equality comparisons of FP zero (PR22376)

In http://reviews.llvm.org/D6911, we allowed GVN to propagate FP equalities
to allow some simple value range optimizations. But that introduced a bug
when comparing to -0.0 or 0.0: these compare equal even though they are not
bitwise identical.

This patch disallows propagating zero constants in equality comparisons.
Fixes: http://llvm.org/bugs/show_bug.cgi?id=22376
Differential Revision: http://reviews.llvm.org/D7257

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227491 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/GVN.cpp
test/Transforms/GVN/edge.ll