InstCombine: support floating-point equivalences (#114975)
commit9568f88b7f05015a438ed8beb4f4d07782c34dc2
authorRamkumar Ramachandra <ramkumar.ramachandra@codasip.com>
Wed, 20 Nov 2024 09:44:14 +0000 (20 09:44 +0000)
committerGitHub <noreply@github.com>
Wed, 20 Nov 2024 09:44:14 +0000 (20 09:44 +0000)
tree2278583a6d282920d15a9a540ad0f08759ce743b
parent09c41246ed58344892a1a82f7256a4ad6e1c49d7
InstCombine: support floating-point equivalences (#114975)

Since cd16b07 (IR: introduce CmpInst::isEquivalence), there is now an
isEquivalence routine in CmpInst that we can use to determine
equivalence in foldSelectValueEquivalence. Implement this, extending it
to include floating-point equivalences as well.
llvm/lib/Transforms/InstCombine/InstCombineInternal.h
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/select-binop-cmp.ll
llvm/test/Transforms/InstCombine/select-value-equivalence.ll