================
@@ -2013,21 +2013,24 @@ static Constant *getFPClassConstant(Type *Ty, 
FPClassTest Mask,
   if (Mask == fcPosZero)
     return Constant::getNullValue(Ty);
 
-  // Turn any possible snans into quiet if we can.
-  if (Mask == fcNan && IsCanonicalizing)
-    return ConstantFP::getQNaN(Ty);
-
   // TODO: Support aggregate types that are allowed by FPMathOperator.
   if (Ty->isAggregateType())
     return nullptr;
 
+  // Turn any possible snans into quiet if we can.
+  if (Mask == fcNan && IsCanonicalizing)
+    return ConstantFP::getQNaN(Ty);
+
   switch (Mask) {
   case fcNegZero:
     return ConstantFP::getZero(Ty, true);
   case fcPosInf:
     return ConstantFP::getInfinity(Ty);
   case fcNegInf:
     return ConstantFP::getInfinity(Ty, true);
+  case fcQNan:
----------------
dtcxzyw wrote:

It is identical to modifying the check `Mask == fcNan` to (Mask & fcQNan) != 
fcNone. BTW, can we just return a poison when Mask == fcSNan && 
IsCanonicalizing?

https://github.com/llvm/llvm-project/pull/176123
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to