This revision was automatically updated to reflect the committed changes.
Closed by commit rL261350: [OpenCL] Generate metadata for opencl_unroll_hint
attribute (authored by stulova).
Changed prior to commit:
http://reviews.llvm.org/D16686?vs=47716&id=48513#toc
Repository:
rL LLVM
http://re
pxli168 accepted this revision.
pxli168 added a comment.
Sorry for the late reply, I was on a break.
LGTM!
http://reviews.llvm.org/D16686
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm
yaxunl added a comment.
ping
http://reviews.llvm.org/D16686
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
pekka.jaaskelainen accepted this revision.
pekka.jaaskelainen added a comment.
LGTM.
http://reviews.llvm.org/D16686
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Anastasia added a comment.
@Pekka, Xiuli, Richard, any more comments here?
Thanks!
http://reviews.llvm.org/D16686
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
yaxunl updated this revision to Diff 47716.
yaxunl marked an inline comment as done.
yaxunl added a comment.
Revised as Anastasia suggested.
Changed comments.
http://reviews.llvm.org/D16686
Files:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticP
Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.
LGTM!
Comment at: lib/CodeGen/CGLoopInfo.cpp:134
@@ +133,3 @@
+// 1 - disable unroll
+// other positive integer n - unroll by n
+if (OpenCLHint) {
--
yaxunl updated this revision to Diff 47460.
yaxunl added a comment.
merge two sema tests as one as Anastasia suggested.
http://reviews.llvm.org/D16686
Files:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Basic/Diagn
Anastasia added inline comments.
Comment at: test/SemaOpenCL/unroll-hint-cl20.cl:1
@@ +1,2 @@
+//RUN: %clang_cc1 -O0 -cl-std=CL2.0 -fsyntax-only -verify %s
+
Could we just combine this with test/SemaOpenCL/unroll-hint.cl.
You can have two RUN lines and pass somet
yaxunl updated this revision to Diff 47337.
yaxunl marked 4 inline comments as done.
yaxunl added a comment.
Sorry for the delay.
Revised as Xiuli suggested.
http://reviews.llvm.org/D16686
Files:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticPa
Anastasia added inline comments.
Comment at: lib/Parse/ParseStmt.cpp:2214
@@ +2213,3 @@
+
+bool Parser::ParseOpenCLUnrollHintAttribute(ParsedAttributes &Attrs) {
+ MaybeParseGNUAttributes(Attrs);
pxli168 wrote:
> Anastasia wrote:
> > pxli168 wrote:
> > > I am won
pxli168 added a reviewer: rsmith.
pxli168 added a comment.
Hi richard,
What is your opinion about where to put this ParseOpenCLUnrollHintAttribute?
Thanks
Xiuli
Comment at: lib/Parse/ParseStmt.cpp:2214
@@ +2213,3 @@
+
+bool Parser::ParseOpenCLUnrollHintAttribute(ParsedAttribut
Anastasia added inline comments.
Comment at: lib/Parse/ParseStmt.cpp:2214
@@ +2213,3 @@
+
+bool Parser::ParseOpenCLUnrollHintAttribute(ParsedAttributes &Attrs) {
+ MaybeParseGNUAttributes(Attrs);
pxli168 wrote:
> I am wondering where should this function goes in,
pxli168 added a comment.
Hi Pekka/Anastasia,
I find that most of the attribute parses was done in ParseDecl.cpp, should this
also be in there?
Thanks
Xiuli
Comment at: lib/Parse/ParseStmt.cpp:2214
@@ +2213,3 @@
+
+bool Parser::ParseOpenCLUnrollHintAttribute(ParsedAttributes &
yaxunl updated the summary for this revision.
yaxunl updated this revision to Diff 46961.
yaxunl marked 3 inline comments as done.
yaxunl added a comment.
Revised as Xiuli suggested.
Add test for OpenCL below 2.0.
Add diagnostic for opencl_unroll_hint attribute used below OpenCL 2.0.
http://revi
pxli168 added inline comments.
Comment at: lib/CodeGen/CGLoopInfo.cpp:131
@@ +130,3 @@
+// equivalent LoopHintAttr enums.
+// See OpenCL v2.0 s6.11.5 for details.
+// 0 corresponds to opencl_unroll_hint attribute without
Can you also change this commen
yaxunl updated this revision to Diff 46838.
yaxunl marked 3 inline comments as done.
yaxunl added a comment.
Revised as Anastasia suggested.
http://reviews.llvm.org/D16686
Files:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticParseKinds.td
incl
Anastasia added inline comments.
Comment at: lib/Sema/SemaStmtAttr.cpp:230
@@ +229,3 @@
+ << A.getName() << AANT_ArgumentIntegerConstant <<
E->getSourceRange();
+ return 0;
+}
0 -> nullptr
http://reviews.llvm.org/D16686
yaxunl updated this revision to Diff 46783.
yaxunl marked an inline comment as done.
yaxunl added a comment.
Revised as Xiuli suggested.
With the change, there will be quotation marks around the attribute name, so
other diagnostics are also changed to be consistent.
http://reviews.llvm.org/D16
pxli168 added inline comments.
Comment at: lib/Sema/SemaStmtAttr.cpp:216
@@ +215,3 @@
+S.Diag(A.getLoc(), diag::err_attribute_too_many_arguments)
+<< "opencl_unroll_hint" << 1;
+return nullptr;
I think you should not use hard code here, just use A.
yaxunl updated this revision to Diff 46651.
yaxunl marked 9 inline comments as done.
yaxunl added a comment.
Revised as Xiuli and Anastasia suggested.
http://reviews.llvm.org/D16686
Files:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticParseKinds
Anastasia added inline comments.
Comment at: lib/Sema/SemaStmtAttr.cpp:225
@@ +224,3 @@
+Expr *E = A.getArgAsExpr(0);
+assert(E != nullptr && "Invalid opencl_unroll_hint argument");
+llvm::APSInt ArgVal(32);
pxli168 wrote:
> Is this necessary as you ha
pxli168 added inline comments.
Comment at: lib/Sema/SemaStmtAttr.cpp:208
@@ +207,3 @@
+SourceRange Range) {
+ assert(A.getKind() == AttributeList::AT_OpenCLUnrollHint);
+
This is also not necessary because this function can be
yaxunl updated this revision to Diff 46608.
yaxunl added a comment.
Add test for negative unroll hint value as suggested by Xiuli.
http://reviews.llvm.org/D16686
Files:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticParseKinds.td
include/clang/
pxli168 added inline comments.
Comment at: test/SemaOpenCL/unroll-hint.cl:22
@@ +21,2 @@
+}
+#endif
It seems the negative integer invalid test is missing?
I think it was in your last diff.
http://reviews.llvm.org/D16686
__
yaxunl updated this revision to Diff 46570.
yaxunl marked 7 inline comments as done.
yaxunl added a comment.
Revised as Anastasia suggested.
http://reviews.llvm.org/D16686
Files:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticParseKinds.td
incl
Anastasia added inline comments.
Comment at: include/clang/Parse/Parser.h:2200
@@ -2199,1 +2199,3 @@
void ParseOpenCLQualifiers(ParsedAttributes &Attrs);
+ /// \brief Parses opencl_unroll_hint attribute if language is OpenCL 2.0+.
+ /// \return false if error happens.
---
yaxunl updated this revision to Diff 46526.
yaxunl added a comment.
update the tests.
http://reviews.llvm.org/D16686
Files:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/
yaxunl updated this revision to Diff 46434.
yaxunl marked 17 inline comments as done.
yaxunl added a comment.
Revised as Anastasia and Xiuli suggested.
http://reviews.llvm.org/D16686
Files:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticParseKind
Anastasia added inline comments.
Comment at: include/clang/Basic/Attr.td:661
@@ +660,3 @@
+ let Args = [UnsignedArgument<"UnrollHint">];
+ let Documentation = [Undocumented];
+}
I think undocumented is not allowed any longer.
I suggest you to check OpenCLGeneri
pxli168 added inline comments.
Comment at: include/clang/Basic/DiagnosticParseKinds.td:906
@@ +905,3 @@
+def err_opencl_unroll_hint_on_non_loop : Error<
+ "OpenCL only supports opencl_unroll_hint on for, while, and do statements">;
+
you can change it to opencl_u
yaxunl created this revision.
yaxunl added reviewers: Anastasia, pxli168, pekka.jaaskelainen.
yaxunl added subscribers: tstellarAMD, cfe-commits.
Add codegen and diagnostics for opencl_unroll_hint attribute.
The code is based on Khronos OpenCL compiler
(https://github.com/KhronosGroup/SPIR/tree/
32 matches
Mail list logo