r339392 - Added LLVM metadata to generated IR to increase vectorization width
Emmett Neyman via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 9 14:59:01 PDT 2018
Author: emmettneyman
Date: Thu Aug 9 14:59:01 2018
New Revision: 339392
URL: http://llvm.org/viewvc/llvm-project?rev=339392&view=rev
Log:
Added LLVM metadata to generated IR to increase vectorization width
Summary: 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.
Reviewers: morehouse, kcc
Reviewed By: morehouse
Subscribers: cfe-commits, llvm-commits
Differential Revision: https://reviews.llvm.org/D50530
Modified:
cfe/trunk/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp
Modified: cfe/trunk/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp?rev=339392&r1=339391&r2=339392&view=diff
==============================================================================
--- cfe/trunk/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp (original)
+++ cfe/trunk/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp Thu Aug 9 14:59:01 2018
@@ -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 @@ std::ostream &operator<<(std::ostream &o
<< 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";
}
// ---------------------------------
More information about the cfe-commits
mailing list