Edited loop_proto_to_llvm to emit metadata at the end of the generated IR. This metadata will increase the vector width when the IR is optimized.
Details
Diff Detail
- Repository
- rC Clang
- Build Status
Buildable 21299 Build 21299: arc lint + arc unit
Event Timeline
clang/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp | ||
---|---|---|
142 | 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? | |
143 | Does this metadata change coverage in the vectorizer? | |
clang/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.h | ||
18 ↗ | (On Diff #159978) | This include should be in the cpp file. |
clang/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp | ||
---|---|---|
142 | 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. | |
143 | 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. |
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?