[PATCH] D118635: [GlobalISel] Combine: (G_*MULO x, 0) -> 0 + no carry out

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 18:39:07 PST 2022


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:4574-4587
+    if (!isLegalOrBeforeLegalizer(
+            {TargetOpcode::G_BUILD_VECTOR, {DstTy, DstEltTy}}) ||
+        !isLegalOrBeforeLegalizer({TargetOpcode::G_CONSTANT, {DstEltTy}}))
+      return false;
+    LLT CarryEltTy = CarryTy.getElementType();
+    if (!isLegalOrBeforeLegalizer(
+            {TargetOpcode::G_BUILD_VECTOR, {CarryTy, CarryEltTy}}) ||
----------------
This condition is way too complicated and common to put here like this. We probably should have a predicate like isConstantUnsupported in the artifact combiner somewhere


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

https://reviews.llvm.org/D118635



More information about the llvm-commits mailing list