[PATCH] D155095: TargetLowering: fix an infinite DAG combine in SimplifySETCC

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 15:23:29 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:4237
   ISD::CondCode SwappedCC = ISD::getSetCCSwappedOperands(Cond);
-  if (N0ConstOrSplat && (!OpVT.isScalableVector() || !N1ConstOrSplat) &&
+  if (N0ConstOrSplat && ((!OpVT.isScalableVector() && N0Splat && !N1Splat) ||
+                         !N1ConstOrSplat) &&
----------------
I'm not sure about the logic of this carve out. splat_vector is primarily used with scalable vectors. So checking it is not a scalable vector, but N0 is a splat_vector seems odd.


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

https://reviews.llvm.org/D155095



More information about the llvm-commits mailing list