[PATCH] D158648: InstCombine: Introduce SimplifyDemandedUseFPClass

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 13:50:45 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:1825
+    Known = computeKnownFPClass(V, DL, fcAllFlags, Depth, &TLI, &AC, CxtI, &DT);
+    if ((DemandedMask & Known.KnownFPClasses) == fcNone)
+      return PoisonValue::get(VTy);
----------------
nikic wrote:
> Should this be using getFPClassConstant() instead, just like the main code path?
No, otherwise it will infinite loop since constants will always yield the same result after simplification. The isa<UndefValue> check above is the special case that works for poison


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158648/new/

https://reviews.llvm.org/D158648



More information about the llvm-commits mailing list