[PATCH] D70866: Improve SLP code snippet

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 2 08:34:45 PST 2019


spatel added inline comments.


================
Comment at: llvm/docs/Vectorizers.rst:420
 
-  void foo(int a1, int a2, int b1, int b2, int *A) {
-    A[0] = a1*(a1 + b1)/b1 + 50*b1/a1;
-    A[1] = a2*(a2 + b2)/b2 + 50*b2/a2;
+  void foo(long a1, long a2, long b1, long b2, long *A) {
+    A[0] = a1*(a1 + b1);
----------------
I understand that integer division is a poor example for vectorization because most targets can't handle it.
But what is the intent of changing 'int' to 'long' in this example? That change appears to prevent vectorization (for most x86 targets at least).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70866/new/

https://reviews.llvm.org/D70866





More information about the llvm-commits mailing list