[llvm-commits] [PATCH] x86: Allow using unpack for shuffles in more situations

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Fri Jul 22 17:40:57 PDT 2011


Hi,

> Another thing I noticed about this code is that it only uses unpack for OptSize. Take a quick look here http://www.agner.org/optimize/instruction_tables.pdf I didn't see any cases where pshufd was faster than unpack. Do you know if the OptSize check is needed?

If not for latency issues, I think there's no reason at all,
historically it was made that way. I have plans to clean up all this,
but not right away, so if you want to send patches I can review for
you! Just make sure to update the tests or create new ones in case
nothing breaks!

In overall this code is a little bit better than it was before (when
everything was matched during isel) but is still very fragile.
Changing something in some place can actually enable the matching of a
shuffle that is not the one you want. That's why things are really
explicit there (like the type checking) as guidelines.

The only issue we would have is the penalty of switching between
integer and fp units (as some unpacks are fp and pshufd is int, and
this applies to a lot of other shuffles) but to fix that we would need
a pass anyway (like SSEDomainFix does for int/fp loads/stores).


-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc




More information about the llvm-commits mailing list