[SDAG] Allow scalable vectors in ComputeKnownBits (try 2)
authorPhilip Reames <preames@rivosinc.com>
Mon, 5 Dec 2022 16:49:42 +0000 (08:49 -0800)
committerPhilip Reames <listmail@philipreames.com>
Mon, 5 Dec 2022 16:52:37 +0000 (08:52 -0800)
commit7969ab85e0a413eeba2bf4360f0c7ea6c5f00e4c
tree47eb0edf750207aa6276fc1e135d5ecd7a7a80c0
parent6887cfb982d3a590a4d81123b2d68cb056773166
[SDAG] Allow scalable vectors in ComputeKnownBits (try 2)

This was previously reverted due to a hang on a Hexagon bot.  This turned out to be a bug in the Hexagon backend around how splat_vectors are legalized (which they're using for fixed length vectors!).  I adjusted this patch to remove the implicit truncate support.  This hides the hexagon bug for now, and unblocks the rest of the change.

Original commit message:

This is the SelectionDAG equivalent of D136470, and is thus an alternate patch to D128159.

The basic idea here is that we track a single lane for scalable vectors which corresponds to an unknown number of lanes at runtime. This is enough for us to perform lane wise reasoning on many arithmetic operations.

This patch also includes an implementation for SPLAT_VECTOR as without it, the lane wise reasoning has no base case. The original patch which inspired this (D128159), also included STEP_VECTOR. I plan to do that as a separate patch.

Differential Revision: https://reviews.llvm.org/D137140
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/AArch64/sve-intrinsics-index.ll
llvm/test/CodeGen/AArch64/sve-intrinsics-perm-select.ll
llvm/test/CodeGen/AArch64/sve-umulo-sdnode.ll