AVX512: We don't always need EVEX for VEX-encodable instructions.
| Bugzilla Link | 23376 |
| Resolution | FIXED |
| Resolved on | Feb 22, 2017 18:55 |
| Version | trunk |
| OS | All |
| CC | @ahmedbougacha,@delena |
Extended Description
This:
define float @t(float %a, float %b) { %res = fadd float %a, %b ret float %res }
Generates the EVEX-prefixed:
62f17e0858c1 vaddss %xmm1, %xmm0, %xmm0
instead of using VEX:
c5fa58c1 vaddss %xmm1, %xmm0, %xmm0
AFAIK, there is no transition penalty between AVX512 and AVX, so I believe the only reason to use EVEX in this case is to access more registers (xmm0-31).
That's not always useful, so we should recognize that, and relax EVEX->VEX when possible.
Apologies; I should have searched more before replying. Appears https://reviews.llvm.org/D28221 is the actual issue. Again, sorry for wasting time here.
(Sorry this is against llvm 3.9.1)
Could this issue explain the following problem I'm seeing. On a i7-6600U (skylake) box using llvm directly , I get some EVEX encoded instructions even though the i7-6600U doesn't support AVX512 leading to a SIGILL. Or is that a separate issue I should file?
Thanks, Matt
The bug was fixed in a patch to X86 AVX512 on LLVM revision 290649. Changed date is 2016-12-28.
I agree, it may be a pass after register allocation, that will take EXEX instructions with xmm/ymm 0-15 and replace them with appropriate VEX instrcutions.