emmettneyman added inline comments.

================
Comment at: clang/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp:141
+            << "!1 = !{!\"llvm.loop.vectorize.enable\", i1 true}\n"
+            << "!2 = !{!\"llvm.loop.vectorize.width\", i32 " << kArraySize
+            << "}\n";
----------------
morehouse wrote:
> I'm not sure `kArraySize` is what you want here.  Does "width" refer to array 
> size or the SIMD width?
> 
> Any problem with letting the vectorizer determine this automatically?
The "width" refers to how wide the vector types should be in the outputted IR. 
So for example, a width of 64 would produce IR instructions with the type `<64 
x i32>`. 

The problem with letting the vectorizer determine the width automatically is 
that since the length of the arrays (and so, the number of loop iterations) is 
passed to the function as a parameter, the vectorizer always chooses the 
default width of 4 when running the loop vectorize optimization pass.


================
Comment at: clang/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp:142
+            << "!2 = !{!\"llvm.loop.vectorize.width\", i32 " << kArraySize
+            << "}\n";
 }
----------------
morehouse wrote:
> Does this metadata change coverage in the vectorizer?
I'm running the coverage now, but my guess is yes. Because this metadata 
overrides the default behavior of the loop vectorizer, I think it will increase 
the coverage.


Repository:
  rC Clang

https://reviews.llvm.org/D50530



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to