[PATCH] improve vectorizers by removing cost of unnecessary truncs and exts.

Demikhovsky, Elena elena.demikhovsky at intel.com
Mon May 11 04:13:05 PDT 2015


+        if (Opcode == Instruction::Trunc) {
+          if (TTI->isTypeLegal(DstVecTy)) {
+            VecCost = 0;
+          }

On AVX-512 the "truncate" is usually one instruction, the VecCost should be 1.
On AVX the type may be legal, but "truncate" is more than one instruction.

-           Elena

From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Sam Parker
Sent: Monday, May 11, 2015 13:57
To: llvm-commits at cs.uiuc.edu
Subject: [PATCH] improve vectorizers by removing cost of unnecessary truncs and exts.

Hi,

I've attached a patch to both the loop vectorizer and slp-vectorizer which checks to see whether truncs and extensions would actually be required if the code was vectorized. This is so that the vectorizers understand that the cost of these instructions is effectively zero if vectorization happens. This is helpful when working on smaller data types, such as i8 and i16, that do not have native support in general purpose registers, but are supported in vector register files.

Regards,
Sam


---------------------------------------------------------------------
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150511/2ea3a40a/attachment.html>


More information about the llvm-commits mailing list