[PATCH] D144018: [AArch64] More consistently use buildvector for zero and all-ones constants

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 09:10:46 PST 2023


david-arm added a comment.

Looks sensible to me! I just had one minor comment ...



================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:12449
+    SDValue Val = Vec;
+    if (!ISD::isConstantSplatVectorAllOnes(Vec.getNode()) &&
+        !ISD::isConstantSplatVectorAllZeros(Vec.getNode())) {
----------------
Instead of asking this question for the build vector `Vec` can you just instead test `ConstantValue` for 0 or 1 instead, since it's probably cheaper?


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

https://reviews.llvm.org/D144018



More information about the llvm-commits mailing list