[PATCH] D158648: InstCombine: Introduce SimplifyDemandedUseFPClass

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 11:50:01 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);
----------------
goldstein.w.n wrote:
> goldstein.w.n wrote:
> > nikic wrote:
> > > arsenm wrote:
> > > > 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
> > > Check that getFPClassConstant() != V?
> > > 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
> > 
> > 
> > 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
> 
> Isn't the same true in the many places you return `I`?
No, because in those cases a change was made 


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

https://reviews.llvm.org/D158648



More information about the llvm-commits mailing list