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

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 10:04:22 PST 2023


dmgreen added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:12449
+    SDValue Val = Vec;
+    if (!ISD::isConstantSplatVectorAllOnes(Vec.getNode()) &&
+        !ISD::isConstantSplatVectorAllZeros(Vec.getNode())) {
----------------
david-arm wrote:
> 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?
Zero's are simple, but all-ones are a little more complex due to promotion of the constants to 32bits.


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

https://reviews.llvm.org/D144018



More information about the llvm-commits mailing list