[PATCH] D74782: [llvm][CodeGen] DAG Combiner folds for vscale.

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 03:05:48 PST 2020


andwar added a comment.

@fpetrogalli Thank you for working on this! A few nits, but nothing blocking. LGTM!



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2330
 
+  // Fold (add (vscale * C0), (vscale * C1)) to (vscale * C0 + C1))
+  if (N0.getOpcode() == ISD::VSCALE && N1.getOpcode() == ISD::VSCALE) {
----------------
[nit] Missing opening bracket: `(vscale * C0 + C1))` --> `(vscale * (C0 + C1))`


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3601
 
+  // Fold (mul (vscale * C0), C1) to (vscale * (C0 * C1)))
+  if (N0.getOpcode() == ISD::VSCALE)
----------------
[nit] Brackets: `Fold (mul (vscale * C0), C1) to (vscale * (C0 * C1)))` --> `Fold (mul (vscale * C0), C1)) to (vscale * (C0 * C1))``


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:7782
 
+  // Fold (shl (vscale * C0), C1) to (vscale * (C0 << C1)))
+  if (N0.getOpcode() == ISD::VSCALE)
----------------
[nit] `(shl (vscale * C0), C1) to (vscale * (C0 << C1)))` --> `(shl (vscale * C0), C1)) to (vscale * (C0 << C1))` :)


================
Comment at: llvm/test/CodeGen/AArch64/sve-vscale-combine.ll:73
+}
+
+
----------------
[nit] Extra line


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74782





More information about the llvm-commits mailing list