[PATCH] D41096: [X86] Initial support for prefer-vector-width function attribute

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 11:41:37 PST 2017


efriedma added a comment.

> If it finds any vector code, the pass would override the prefer-vector-width attribute to the length of the widest vector in that code.

That makes sense... sort of.  If this target-specific pass runs as part of the optimization pass pipeline (as opposed to the codegen pass pipeline), we need to make sure we generate correct code even if the optimization pass doesn't run (if someone is using -O0, opt-bisect, etc.).  So we probably need two attributes: one clang attribute "try to avoid zmm registers if possible" and one attribute "disable all avx-512 instructions which use zmm registers", and we only set the second attribute if we've analyzed the function and proved we don't need to use zmm registers.


https://reviews.llvm.org/D41096





More information about the llvm-commits mailing list