[PATCH] D122594: [ArgPromotion] Update min-legal-vector-width when do promotion

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 1 19:46:26 PDT 2022


pengfei added a comment.

I don't think "unstable ABI" makes much sense. As far as I understand it, ABI is a protocol that makes functions callable and linkable. ABI can be upgraded, but the first priority is compatibility, both forward and backward. Because there's no ABI information left once we compile it into binary.
"abi-vector-width" doesn't help with that , unless we mangle the function with the ABI, something like `foo.avx2`, `bar.avx512` etc.
So my point is there are only ABI and ABI undefined behaviors, i.e, non ABI implementations. "unstable ABI" is not ABI.
Here are concrete examples: https://godbolt.org/z/zna8f6631
What I want to show from the examples are:

1. All the first 3 functions are not linkable by functions comply with AVX512 ABI;
2. Both `abi256_minlegal256` and `abi256_minlegal512` are ABI undefined behaviors, they shouldn't be generated by user's code or any compiler optimizations. We don't need to care about them;
3. `abi512_minlegal256` is the bug we are fixing here;
4. "target-cpu" has the same functionality with "abi-vector-width";
5. Large "min-legal-vector-width" is always safe though vector width out of the capability of "target-cpu" is ABI undefined behavior;

Another reason increasing "min-legal-vector-width" is safe is we take no "min-legal-vector-width" attribute as UINT32_MAX: https://github.com/llvm/llvm-project/blob/3db9fd51b5158afae7352f60f5a89fecd0638210/llvm/lib/Target/X86/X86TargetMachine.cpp#L272-L283


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122594



More information about the llvm-commits mailing list