[llvm] [AArch64][CodeGen] Fold tbx(splat(0), table, idxs) to tbl(table, idxs) (PR #214268)

Harry Ramsey via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 02:08:53 PDT 2026


================
@@ -25071,6 +25069,31 @@ static SDValue performIntrinsicCombine(SDNode *N,
   switch (IID) {
   default:
     break;
+  case Intrinsic::aarch64_neon_tbx1:
+  case Intrinsic::aarch64_neon_tbx2:
+  case Intrinsic::aarch64_neon_tbx3:
+  case Intrinsic::aarch64_neon_tbx4: {
+    if (ISD::isBuildVectorAllZeros(N->getOperand(1).getNode())) {
+      unsigned TblIID = 0;
+      if (IID == Intrinsic::aarch64_neon_tbx1)
----------------
Harry-Ramsey wrote:

It might be better to use a switch case here with a default for an error:
`llvm_unreachable("...");`

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


More information about the llvm-commits mailing list