[PATCH] D52934: [FPEnv] PatternMatcher support for checking FNEG ignoring signed zeros

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 8 08:00:50 PDT 2018


spatel added inline comments.


================
Comment at: include/llvm/IR/PatternMatch.h:672
+inline BinaryOp_match<cstfp_pred_ty<is_any_zero_fp>, RHS, Instruction::FSub>
+m_ISZFNeg(const RHS &X) {
+  return m_FSub(m_AnyZeroFP(), X);
----------------
cameron.mcinally wrote:
> spatel wrote:
> > Let's use the existing LLVM vocabulary for "ignore signed zero":
> > "m_FNegNSZ"
> Thanks, I didn't know that existed.
> 
> Do you want "NSZ" to be a suffix? I noticed that the others, like NSW, are prefixed: m_NSWAdd(...).
> 
> There are subtle differences between those, so I don't have a strong opinion either way.
> 
> 
> 
> 
Ah, I didn't notice that difference. 

The suffixed version looks less like alphabet soup to me, corresponds to the order you'd see that string in IR, and corresponds to the "BinaryOperator::CreateFNegFMF()" format (bias: I added that).

So yes, my vote is m_FNegNSZ. Unless there's some reason to keep the existing names for the overflowing matchers, I'd change all of them as an NFC formatting commit for consistency.


https://reviews.llvm.org/D52934





More information about the llvm-commits mailing list