[LoopVectorizer] Shuffle cost in getInterleaveGroupCost()

Demikhovsky, Elena via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 21 13:39:22 PDT 2018


I agree that the "reversing" should be a part of interleaving and there is not always extra cost for it. But still, it depends on target. In some cases cross-lane shuffles required for the negative stride are more expensive. I assume you can pass IsReverse as parameter to TTI.getInterleavedMemoryOpCost() and let target decide how to calculate the final cost.

-----Original Message-----
From: Jonas Paulsson [mailto:paulsson at linux.vnet.ibm.com] 
Sent: Friday, September 21, 2018 18:06
To: Demikhovsky, Elena <elena.demikhovsky at intel.com>
Cc: Jonas Paulsson via llvm-commits <llvm-commits at lists.llvm.org>
Subject: [LoopVectorizer] Shuffle cost in getInterleaveGroupCost()

Hi,

looking at getInterleaveGroupCost() in LoopVectorize.cpp, I find it odd that a cost for shuffles is added if the stride is negative. All the costs for extracting and inserting all the elements are already added, and it seems those operations should produce the final result. I mean, for a reversed vector the elements would simply be inserted starting from the opposite end, or?

Removing that is nearly NFC on spec for SystemZ - just one loop changes on SPEC, so it's not really any issue for me. It just looks like something to remove, but I may be wrong...

/Jonas

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


More information about the llvm-commits mailing list