[PATCH] D36479: [X86][AVX512] Choose correct registers in vpbroadcastb/w
Guy Blank via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 8 11:49:17 PDT 2017
guyblank created this revision.
This patch addresses pr33795 <https://bugs.llvm.org/show_bug.cgi?id=33795>
The vpbroadcastb/w instructions flavor which broadcasts a byte/word from the lower part of a GPR to an XMM/YMM/ZMM, should use the full GPR as the source operand.
But currently it uses the GR8/16 regclasses attempting to match the subregisters corresponding to the part being broadcast.
In most cases this turns out ok since the encoding for AL,BL,CL,DL is the same as their full registers. But, as seen in the bug report, when CH is chosen, the encoding actually matches EBP.
Plus, CH shouldn't have been used at all since it isn't the lower part of a GPR.
The patch adds td patterns and classes to move the source value from the subregister to the full register and use it in the broadcast.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 15982 bytes
Desc: not available
More information about the llvm-commits