Added most of the missing vector folding patterns for AVX2 (as well as fixing the vpermpd and verpmq patterns)
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
What bothers me a bit is that all of the pre-existing broadcast instructions have TB_NO_REVERSE, and the new ones don't.
Unfortunately I can't remember *why* they have TB_NO_REVERSE.
Nadav, do you remember, by any chance?
I believe its because the VBROADCASTS{SD}rr register instructions were an AVX2 addition while the VBROADCASTS{SD}rm memory instructions were available from AVX1 - so it prevents unfolding from introducing an illegal instruction on AVX1 targets. The VPBROADCAST instructions are all AVX2 instructions so don't need an equivalent limitation.
Nadav might be able to confirm?
Thanks Michael + Nadav - I should add that I don't know why the AVX-512 broadcast instructions have set TB_NO_REVERSE - I'm assuming its just a copy + paste error but I don't know enough about the ISA to recommend its removal.