[PATCH] D101369: [AArch64][SVE] Fold insert(zero, extract(X, 0), 0) -> X, when X is known to zero lanes 1-N

Peter Waller via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 27 08:58:26 PDT 2021


peterwaller-arm accepted this revision.
peterwaller-arm added a comment.
This revision is now accepted and ready to land.

LGTM, modulo nit.

Test suggestion: what about testing an insert into a non zeroinitializer vector?



================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:16048
+    SDValue Res = performInsertVectorEltCombine(N, DAG);
+    if (Res == SDValue())
+      return performPostLD1Combine(N, DCI, true);
----------------
Nit: indent.

Also suggestion: `if (Res != SDValue()) return Res;`, that way the code can be extended to handle other combines that come in the future with minimal further changes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101369



More information about the llvm-commits mailing list