[FPEnv][InstSimplify] Fold fadd X, 0 ==> X, when we know X is not -0
authorKevin P. Neal <kevin.neal@sas.com>
Thu, 14 Oct 2021 16:31:31 +0000 (12:31 -0400)
committerKevin P. Neal <kevin.neal@sas.com>
Thu, 14 Oct 2021 16:32:45 +0000 (12:32 -0400)
commit727a891ec8c42b134dfd9ac8b830fb6072d34ef3
tree8e1a0af77326ecdad3f9ea2a54c61a5a16c4e401
parentf7ba572483dd424c6235901d1c6cb3650c46b477
[FPEnv][InstSimplify] Fold fadd X, 0 ==> X, when we know X is not -0

Currently the fadd optimizations in InstSimplify don't know how to do this
NoSignedZeros "X + 0.0 ==> X" fold when using the constrained intrinsics.
This adds the support.

This review is derived from D106362 with some improvements from D107285
and is a follow-on to D111085.

Differential Revision: https://reviews.llvm.org/D111450
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/strictfp-fadd.ll