[PatternMatch] Add new FP matchers. NFC.
authorJay Foad <jay.foad@amd.com>
Fri, 16 Oct 2020 12:54:19 +0000 (13:54 +0100)
committerJay Foad <jay.foad@amd.com>
Thu, 22 Oct 2020 18:43:12 +0000 (19:43 +0100)
commit922285abec7cdcce1045b979ea1ff1091243bb0b
tree525ec0e130f0b521f3f3c8c6dbec70d095d50d43
parent3e37543111f40c3fa2430a80eb0293ae3b814dd3
[PatternMatch] Add new FP matchers. NFC.

This adds matchers m_NonNaN, m_NonInf, m_Finite and m_NonZeroFP as well
as generic support for binding the matched value to an APFloat.

I tried to follow the existing convention of using an FP suffix for
predicates like zero and non-zero, which could be confused with the
integer versions, but not for predicates which are clearly already
FP-specific.

Differential Revision: https://reviews.llvm.org/D89038
llvm/include/llvm/IR/PatternMatch.h
llvm/unittests/IR/PatternMatch.cpp