[PATCH] Reducing the costs of cast instructions to enable more vectorization of smaller types in LoopVectorize

Sam Parker sam.parker at arm.com
Thu May 21 09:30:12 PDT 2015


Hi Silviu,

Yes, that is how is it implemented at the moment and I agree longer chains should be considered. I just wasn't sure what types of nodes it wouldn't be legal for and would welcome suggestions.

Cheers,
sam

-----Original Message-----
From: silviu.baranga at arm.com [mailto:silviu.baranga at arm.com] 
Sent: 21 May 2015 17:18
To: Sam Parker
Cc: Silviu Baranga; llvm-commits at cs.uiuc.edu; elena.demikhovsky at intel.com; James Molloy; mzolotukhin at apple.com
Subject: Re: [PATCH] Reducing the costs of cast instructions to enable more vectorization of smaller types in LoopVectorize

Hi Sam,

If I understand correctly, this implementation allows for only s/zext -> op -> trunc chains (with only one operation). Is this correct (or perhaps I'm missing something)? I think in theory it should be possible to have arbitrary long chains, depending on what operations are in them.

-Silviu


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:4519
@@ +4518,3 @@
+
+        if (ConstInt->uge((1 << ScalarWidth) - 1))
+          break;
----------------
APInt::getMaxValue(ScalarWidth) should be used as (1 << ScalarWidth) - 1 might return different values depending on the host machine.

================
Comment at: test/Transforms/LoopVectorize/AArch64/loop-vectorization-factors.ll:140
@@ +139,3 @@
+
+!0 = !{!"clang version 3.7.0 (http://llvm.org/git/clang.git 93281cbcbb9b1ea2b6788a629d6aef3284957d05) (http://llvm.org/git/llvm.git 40048e70d7a63ab64df3d0e52107f3c0e3472571)"}
+!1 = !{!2, !2, i64 0}
----------------
I think this would be cleaner without the metadata.

http://reviews.llvm.org/D9822

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/








More information about the llvm-commits mailing list