[llvm] [AArch64][SVE] Handle some cases of uzp1/reinterpret from svbool in isZeroingInactiveLanes (PR #78623)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 00:43:07 PST 2024


================
@@ -283,6 +283,24 @@ static bool isZeroingInactiveLanes(SDValue Op) {
     switch (Op.getConstantOperandVal(0)) {
     default:
       return false;
+
+    case Intrinsic::aarch64_sve_uzp1:
+      return isZeroingInactiveLanes(Op.getOperand(1)) &&
+             isZeroingInactiveLanes(Op.getOperand(2));
----------------
efriedma-quic wrote:

Looking at the reference manual for uzp1, it looks like the instruction inherently zeros the unused lanes: the iteration changes depending on the specified type. So unless I'm missing somtehing, looking at the operands doesn't seem useful.

The way this check works seems inherently a fragile to me: we're assuming the SVE intrinsics in question are getting lowered to precisely the corresponding instructions, and we don't do any optimizations that might affect the bits that aren't part of the type.  But that's not new with this patch.

https://github.com/llvm/llvm-project/pull/78623


More information about the llvm-commits mailing list