[RISCV] Implement isElementTypeLegalForScalableVector TTI hook
authorPhilip Reames <preames@rivosinc.com>
Fri, 10 Jun 2022 20:15:11 +0000 (13:15 -0700)
committerPhilip Reames <listmail@philipreames.com>
Fri, 10 Jun 2022 20:20:58 +0000 (13:20 -0700)
commitf7bb691d6140e83699a89c4adf67c1d850852a9c
tree32a06905ca9f5f4905ebd73262df3252dad4d706
parent0fe88f9679ff6df5a7cce7e89038602c35a5e272
[RISCV] Implement isElementTypeLegalForScalableVector TTI hook

This brings us into alignment with AArch64, and in the process fixes a compiler crash bug in uniform store handling in the vectorizer.

Before the recent invalid cost bailout work, this would have also avoided crashes on invalid costs in some cases. I honestly think the vectorizer should gracefully bailout on uniform stores it can't use a scatter for, but it doesn't, so lets take the path of least resistance here. It's also possible that there are other vectorizer bugs AArch64 isn't seeing because of this hook; we don't want to be finding them either.

Differential Revision: https://reviews.llvm.org/D127514
llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
llvm/test/Transforms/LoopVectorize/RISCV/illegal-type.ll [new file with mode: 0644]