This revision was automatically updated to reflect the committed changes. Closed by commit rL339392: Added LLVM metadata to generated IR to increase vectorization width (authored by emmettneyman, committed by ).
Changed prior to commit: https://reviews.llvm.org/D50530?vs=160016&id=160017#toc Repository: rL LLVM https://reviews.llvm.org/D50530 Files: cfe/trunk/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp Index: cfe/trunk/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp =================================================================== --- cfe/trunk/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp +++ cfe/trunk/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp @@ -15,6 +15,7 @@ #include "loop_proto_to_llvm.h" #include "cxx_loop_proto.pb.h" +#include "../handle-llvm/input_arrays.h" // The following is needed to convert protos in human-readable form #include <google/protobuf/text_format.h> @@ -135,7 +136,11 @@ << x.statements() << "%ctnew = add i64 %ct, 1\n" << "%j = icmp eq i64 %ctnew, %s\n" - << "br i1 %j, label %end, label %loop\n}\n"; + << "br i1 %j, label %end, label %loop, !llvm.loop !0\n}\n" + << "!0 = distinct !{!0, !1, !2}\n" + << "!1 = !{!\"llvm.loop.vectorize.enable\", i1 true}\n" + << "!2 = !{!\"llvm.loop.vectorize.width\", i32 " << kArraySize + << "}\n"; } // ---------------------------------
Index: cfe/trunk/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp =================================================================== --- cfe/trunk/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp +++ cfe/trunk/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp @@ -15,6 +15,7 @@ #include "loop_proto_to_llvm.h" #include "cxx_loop_proto.pb.h" +#include "../handle-llvm/input_arrays.h" // The following is needed to convert protos in human-readable form #include <google/protobuf/text_format.h> @@ -135,7 +136,11 @@ << x.statements() << "%ctnew = add i64 %ct, 1\n" << "%j = icmp eq i64 %ctnew, %s\n" - << "br i1 %j, label %end, label %loop\n}\n"; + << "br i1 %j, label %end, label %loop, !llvm.loop !0\n}\n" + << "!0 = distinct !{!0, !1, !2}\n" + << "!1 = !{!\"llvm.loop.vectorize.enable\", i1 true}\n" + << "!2 = !{!\"llvm.loop.vectorize.width\", i32 " << kArraySize + << "}\n"; } // ---------------------------------
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits