[PATCH] D102687: [RISCV] Ensure shuffle splat operands are type-legal

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 20 03:36:09 PDT 2021


frasercrmck added a comment.

In D102687#2769104 <https://reviews.llvm.org/D102687#2769104>, @craig.topper wrote:

> I think the issue for X86 might be that NewNodesMustHaveLegalTypes is set after type legalization, but vector legalization is allowed to create illegal scalar types. A second type legalization runs after. Maybe we should add a bool parameter to the function that defaults to false, but can be set to true to request a legal type?

Yeah that might be going on but I'm not sure. It's pretty finicky. I think X86 is calling this during lowering, which should be after all legalization? I think it's just managing to get the extracted scalar into a legal form before returning from the lowering method.

>From a brief look, I believe that WebAssembly's use of this method would crash, but it unconditionally "any exts or truncs" the extracted value to i32, which I think (for their set of illegal types) is always folded into the `extract_vector_elt` and so the illegal type is quickly removed.

AArch64's use also looks suspicious but since it's for scatter/gather I found it difficult to get an IR test case together which produces the right DAG.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102687/new/

https://reviews.llvm.org/D102687



More information about the llvm-commits mailing list