[all-commits] [llvm/llvm-project] 487695: [SDAG] Treat DemandedElts argument to isSplatVecto...
Philip Reames via All-commits
all-commits at lists.llvm.org
Tue Oct 11 09:49:48 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 487695e7c99e340c59876853c000403c411af777
https://github.com/llvm/llvm-project/commit/487695e7c99e340c59876853c000403c411af777
Author: Philip Reames <preames at rivosinc.com>
Date: 2022-10-11 (Tue, 11 Oct 2022)
Changed paths:
M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
M llvm/unittests/CodeGen/AArch64SelectionDAGTest.cpp
Log Message:
-----------
[SDAG] Treat DemandedElts argument to isSplatVector as splat for scalable vectors [nfc]
The previous code used a APInt(1, 0) to represent the demanded elts of a scalable vector, and then ignored that argument if type was scalable. This was inconsistent with the UndefElts parameter which is set to either APInt(1, 0) or APInt(1,1) - that is, implicitly broadcast across all lanes. Particularly since the undef code relied on the DemandedElts parameter having bitwidth 1 to achieve that result!
This change switches the demanded parameter to APInt(1,1), documents the broadcast semantics, and takes advantage of it to remove one special case for scalable vectors which is no longer required.
More information about the All-commits
mailing list