This is an alternative way of D139627 suggested by Craig. Creently only X86 backend uses this attribute. Let's just emit for X86 only.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
TargetCodeGenInfo::setTargetAttributes already exists as a place for targets to emit their custom attributes, x86 could emit it there
It's an attractive suggestion. But it's not easy to move it into target code because the value is not a static one but calculated during codegen. As I explained in LangRef, the value is max(maxVectorWidthInArgsRet(CurFn), maxVectorWidthInArgsRet(Callee0), maxVectorWidthInArgsRet(Callee1), ...). We may need to copy/paste a lot of codegen code there to achieve the same goal.
Most of them were done by me in this commit https://reviews.llvm.org/D52441. I either did it for extra coverage or because the tests already checked for #0 and some test cases ended up with #1 due to the different vector lengths.
llvm/docs/LangRef.rst | ||
---|---|---|
2235–2241 | This still should be documented somewhere. I don't know if we document any target attributes specifically in the langref |
This still should be documented somewhere. I don't know if we document any target attributes specifically in the langref