attribute((amdgpu_flat_work_group_size(<min>, <max>))) - request minimum and maximum flat work group size
attribute((amdgpu_waves_per_eu(<min>[, <max>]))) - request minimum and/or maximum waves per execution unit
Details
- Reviewers
aaron.ballman • tstellarAMD arsenm - Commits
- rG5b48d725a0bc: [AMDGPU] Expose flat work group size, register and wave control attributes
rC282371: [AMDGPU] Expose flat work group size, register and wave control attributes
rL282371: [AMDGPU] Expose flat work group size, register and wave control attributes
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/clang/Basic/Attr.td | ||
---|---|---|
1054–1056 ↗ | (On Diff #71382) | This FIXME is now detached from what "this" is referring to. Can you clarify by mentioning that the Subjects list is what should be modified? |
1067 ↗ | (On Diff #71382) | Looking at the documentation, are you sure this should be a VariadicUnsignedArgument? It seems like this should be an UnsignedArgument with the optional bit set. Or can you pass multiple Max values? |
include/clang/Basic/AttrDocs.td | ||
1138 ↗ | (On Diff #71382) | There's an extra space between "can" and "hide". |
1144 ↗ | (On Diff #71382) | Comma after "executed". |
1147 ↗ | (On Diff #71382) | An error instead of The error. |
include/clang/Basic/DiagnosticSemaKinds.td | ||
2385 ↗ | (On Diff #71382) | I think this should say the attribute argument is invalid, rather than the attribute parameter. |
lib/CodeGen/TargetInfo.cpp | ||
6958 ↗ | (On Diff #71382) | Should be const auto *Attr. |
6967–6969 ↗ | (On Diff #71382) | Elide braces? |
6972 ↗ | (On Diff #71382) | const auto * here as well. |
6983–6985 ↗ | (On Diff #71382) | Elide braces? |
6995 ↗ | (On Diff #71382) | const auto * here as well. |
lib/Sema/SemaDeclAttr.cpp | ||
4947 ↗ | (On Diff #71382) | I don't think this case is required (here, or elsewhere). getArgAsExpr() already returns an Expr *. |
4959–4960 ↗ | (On Diff #71382) | Please include this text in the diagnostic rather than hard-coding it here. You can use %select to differentiate between different text snippets in the diagnostic, and the diagnostic doesn't need to continue to try to be generic. Same comment applies elsewhere. |
4988 ↗ | (On Diff #71382) | This will change if you use the optional bit rather than a variadic argument, but this silently eats attributes that have more than two arguments, which is not a good user experience. |
6048 ↗ | (On Diff #71382) | This list is getting to the point where we really need to start handling this in Attr.td soon. Are you planning to work on more AMDGPU attributes in the near future? |
test/SemaOpenCL/amdgpu-attrs.cl | ||
52 ↗ | (On Diff #71382) | I'd like to see a test that shows amdgpu_waves_per_eu with > 2 arguments to make sure it's handled appropriately. |
include/clang/Basic/Attr.td | ||
---|---|---|
1067 ↗ | (On Diff #71382) | You are right. Switched to UnsignedArgument since only one Max is allowed. Thanks. |
lib/Sema/SemaDeclAttr.cpp | ||
6048 ↗ | (On Diff #71382) | I agree, and yes, few more attributes will need to be added in the near future. Would it be ok if I change it to start handling in Attr.td after this change, but before other attributes are added? |
lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
4967 ↗ | (On Diff #71449) | Is it okay to supply 0, 0 as the min, max arguments? |
4997 ↗ | (On Diff #71449) | Is it okay to supply 0, 0 as the min, max arguments? |
6039–6043 ↗ | (On Diff #71449) | Yes, totally fine to be a follow-up patch. I was hoping it would look something like (we can bikeshed the name): def SomeAttr { /* Blah */ } def SomeOtherAttr { let RequiredCompanionAttributes = [SomeAttr]; } |
lib/Sema/SemaDeclAttr.cpp | ||
---|---|---|
4967 ↗ | (On Diff #71449) | Yes, I mentioned 0, 0 case in the docs. |
4997 ↗ | (On Diff #71449) | Yes, I mentioned 0, 0 case in the docs. |
6039–6043 ↗ | (On Diff #71449) | This seems like a good start. Thanks :) |