[llvm] [IR][CodeGen] Add new SizedCapabilityType for use in CodeGen (PR #177192)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 22 06:26:37 PST 2026
nikic wrote:
> > > We had already patched that downstream years ago to be less stupid. The problem that this commit was trying to address was for extended vector types. getExtendedVectorVT calls getTypeForEVT, to create an IR VectorType with an IR element Type inside an EVT. getVectorElementType is then expected to be able to give you back an EVT for the element type without taking a DataLayout, and you want to get the MVT that you started with, in this case cN, as a simple EVT rather than an actual extended EVT. Moreover you need to be able to compute its size.
> >
> >
> > Okay, that case does look hard to avoid. In that case I think my suggestion of using a target extension type should still work. You can give them a layout type of i64/i128 for correct sizing and set the CanBeVectorElement property to allow usage in vectors.
>
> Is a target extension type still appropriate for something that isn't target-specific (given we have AArch64 and RISCV backends being maintained downstream, plus a Mips one that we still keep alive for $reasons; capabilities are a target-independent concept)?
Yes, the type would not actually be target specific, just use the type extension mechanism.
https://github.com/llvm/llvm-project/pull/177192
More information about the llvm-commits
mailing list