diff options
author | Craig Topper <craig.topper@sifive.com> | 2021-10-19 16:10:02 -0700 |
---|---|---|
committer | Craig Topper <craig.topper@sifive.com> | 2021-10-20 07:46:41 -0700 |
commit | fe1f0de00335a8e59aa6c08d1cdae7cf20e14f87 (patch) | |
tree | bee194c97b8a768f60f3a0e0c857d731307cbac7 /clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | |
parent | 60e19f6752b7f19b022d8bdca0937c59b49811f9 (diff) | |
download | llvm-fe1f0de00335a8e59aa6c08d1cdae7cf20e14f87.zip llvm-fe1f0de00335a8e59aa6c08d1cdae7cf20e14f87.tar.gz llvm-fe1f0de00335a8e59aa6c08d1cdae7cf20e14f87.tar.bz2 |
[RISCV][WebAssembly][TargetLowering] Allow expandCTLZ/expandCTTZ to rely on CTPOP expansion for vectors.
Our fallback expansion for CTLZ/CTTZ relies on CTPOP. If CTPOP
isn't legal or custom for a vector type we would scalarize the
CTLZ/CTTZ. This is different than CTPOP itself which would use a
vector expansion.
This patch teaches expandCTLZ/CTTZ to rely on the vector CTPOP
expansion instead of scalarizing. To do this I had to add additional
checks to make sure the operations used by CTPOP expansions are all
supported. Some of the operations were already needed for the CTLZ/CTTZ
expansion.
This is a huge improvement to the RISCV which doesn't have a scalar
ctlz or cttz in the base ISA.
For WebAssembly, I've added Custom lowering to keep the scalarizing
behavior. I've also extended the scalarizing to CTPOP.
Differential Revision: https://reviews.llvm.org/D111919
Diffstat (limited to 'clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions