APFloat: Add isSmallestNormalized predicate function
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 1 Dec 2022 14:12:20 +0000 (09:12 -0500)
committerMatt Arsenault <arsenm2@gmail.com>
Thu, 15 Dec 2022 19:04:26 +0000 (14:04 -0500)
commit191c1d95e880227a13687c77c940f63baf88c594
tree6b94632a7afbc4e624f8a1632226ee3cd1757842
parent992bee045b7586774ffd539bb46d9a1e22896f60
APFloat: Add isSmallestNormalized predicate function

It was annoying to write the check for this in the one case I added,
and I'm planning on adding another, so add a convenient PatternMatch
like for other special case values.

I have no idea what is going on in the DoubleAPFloat case, I reversed
this from the makeSmallestNormalized test. Also could implement this
as *this == getSmallestNormalized() for less code, but this avoids the
construction of a temporary APFloat copy and follows the style of the
other functions.
llvm/include/llvm/ADT/APFloat.h
llvm/lib/Support/APFloat.cpp
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/unittests/ADT/APFloatTest.cpp