[FPEnv][InstSimplify] Fold fsub -0.0, -X ==> X
authorKevin P. Neal <kevin.neal@sas.com>
Fri, 8 Apr 2022 15:47:54 +0000 (11:47 -0400)
committerKevin P. Neal <kevin.neal@sas.com>
Thu, 14 Apr 2022 15:48:54 +0000 (11:48 -0400)
commitd43d9e1d5c98e64db1054b4fb91d044299d3f717
treed0062425c2caa00c919534aa00026e002de82a59
parentf80e47884cf676dfa69dcda1ffa7479b47444f8a
[FPEnv][InstSimplify] Fold fsub -0.0, -X ==> X

Currently the fsub optimizations in InstSimplify don't know how to fold
-0.0 - (-X) to X when the constrained intrinsics are used. This adds partial
support. The rest of the support will come later with work on the IR
matchers.

This review is split out from D107285.

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