[llvm] [CodeGenPrepare] Reverse the canonicalization of isInf/isNanOrInf (PR #81572)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 21:59:11 PST 2024


================
@@ -1943,6 +1943,30 @@ static bool swapICmpOperandsToExposeCSEOpportunities(CmpInst *Cmp) {
   return false;
 }
 
+static bool foldFCmpToFPClassTest(CmpInst *Cmp) {
+  FCmpInst *FCmp = dyn_cast<FCmpInst>(Cmp);
+  if (!FCmp)
+    return false;
+
+  // Reverse the canonicalization if it is a FP class test
----------------
arsenm wrote:

This probably should avoid this is fabs is free and the compare is legal 

https://github.com/llvm/llvm-project/pull/81572


More information about the llvm-commits mailing list