[all-commits] [llvm/llvm-project] 3bf373: [DAG] Use getLegalMaskAndStepVector in expandGetAc...
Luke Lau via All-commits
all-commits at lists.llvm.org
Fri Sep 25 07:27:28 PDT 2026
Branch: refs/heads/users/lukel97/get.active.lane.mask-narrow-legal-type
Home: https://github.com/llvm/llvm-project
Commit: 3bf37375e4fab4267fbdaf3d613f23d36cfa031b
https://github.com/llvm/llvm-project/commit/3bf37375e4fab4267fbdaf3d613f23d36cfa031b
Author: Luke Lau <luke at igalia.com>
Date: 2026-09-25 (Fri, 25 Sep 2026)
Changed paths:
M llvm/include/llvm/CodeGen/TargetLowering.h
M llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
M llvm/test/CodeGen/AArch64/neon-get-active-lane-mask.ll
Log Message:
-----------
[DAG] Use getLegalMaskAndStepVector in expandGetActiveLaneMask
Currently we will either use the mask vector type if it's big enough to fit the elements, or promote the element width to the scalar operand type.
In the latter case we will end up with a vector element type larger than strictly necessary, which means a v32i1 mask will get promoted to v32i64 on RISC-V, which isn't a legal type, and expansion fails.
We can use a legal vector type that's just small enough via getLegalMaskAndStepVector, which is already used by expandVectorFindLastActive, expandCttzElts etc. This fixes crashes on RISC-V and also uses a more compact step vector. It also means we can handle scalable vectors.
We need to move the function into TargetLowering.cpp to use the getLegalMaskAndStepVector, but this brings it inline with the other expansions.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list