-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Correct the tablegen for checking mutually exclusive stmt attrs #3519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The work that was done upstream turned out to be insufficient for checking statement attribute mutual exclusion because attributed statements do not collect their attributes one-at-a-time in the same way that declarations do. So the design that was attempting to check for mutual exclusion as each attribute was processed would not ever catch a mutual exclusion. The new approach is to check all of attributes that are to be applied to the attributed statement in a group. This required generating another DiagnoseMutualExclusions() function into AttrParsedAttrImpl.inc.
@@ -1952,6 +1952,10 @@ def SYCLIntelFPGADisableLoopPipelining : DeclOrStmtAttr { | |||
} | |||
def : MutualExclusions<[SYCLIntelFPGAInitiationInterval, | |||
SYCLIntelFPGADisableLoopPipelining]>; | |||
def : MutualExclusions<[SYCLIntelFPGAIVDep, | |||
SYCLIntelFPGADisableLoopPipelining]>; | |||
def : MutualExclusions<[SYCLIntelFPGAMaxConcurrency, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NB: this is done for completeness in this review but will be in conflict with #3512. Assuming that one lands first, I'll correct the merge conflict in this review.
@@ -615,7 +609,12 @@ class ParsedAttr final | |||
bool diagnoseAppertainsTo(class Sema &S, const Decl *D) const; | |||
bool diagnoseAppertainsTo(class Sema &S, const Stmt *St) const; | |||
bool diagnoseMutualExclusion(class Sema &S, const Decl *D) const; | |||
bool diagnoseMutualExclusion(class Sema &S, const Stmt *St) const; | |||
// This function stub exists for parity with the declaration checking code so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not like this design but I could not think of a more elegant solution. If you have better ideas that don't result in code duplication in checkCommonAttributeFeatures()
, I'm all ears.
raw_ostream &MergeOS) { | ||
raw_ostream &MergeDeclOS, | ||
raw_ostream &MergeStmtOS) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also not in love with this function generating code into three separate streams, but I couldn't think of a better approach that avoids walking the entire list of records from Attr.td multiple times (which slows down compile speeds because there are a fair amount of records in that file these days).
My plan for this is to push the community bits to community after we're happy with the patch here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked through as best I could and didn't see anything (though I'm hoping some of the other reviewers can spend more time on this checking spelling/typos/etc). I don't have any better ideas on implementing either, so I'm generally in favor of this.
@tfzhu, here is another hang on CUDA buildbot. Do you know what is going on? Testing: 0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80..[2021-04-09 16:24:24,148] lit INFO:
LIT test no output within 1200 seconds, start back-trace
[2021-04-09 16:24:24,148] lit INFO: ============================= Start back-trace =============================
sys_bbs+ 21777 0.0 0.0 33168 3000 ? S 16:24 0:00 /bin/sh -c ps aux | grep /localdisk2/sycl_ci/buildbot/worker/Lit_With_Cuda/llvm.obj/tools/sycl/test
sys_bbs+ 21780 0.0 0.0 34844 2436 ? S 16:24 0:00 grep /localdisk2/sycl_ci/buildbot/worker/Lit_With_Cuda/llvm.obj/tools/sycl/test
[2021-04-09 16:24:24,176] lit WARNING: The PID of hang binary not found
[2021-04-09 16:24:24,176] lit INFO: ============================== End back-trace ==============================
[2021-04-09 16:24:24,176] lit INFO: === stage lit end ===
ninja: build stopped: interrupted by user. BTW, I'm not sure if the scrip that tries to find the PID of the processes work for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AaronBallman, this looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you.
* upstream/sycl: (39 commits) [CI] Switch to default clang-format version. (intel#3540) [Driver][NFC] Cleanup some option setting for SYCL offload (intel#3542) [GitHub Actions] Update main branch sync schedule [SYCL][NFC] Fix potential namespace conflicts with PSTL in tuple.hpp (intel#3541) [SYCL] Bump sycl library minor version (intel#3538) [SYCL][CUDA] Implemented cuda_piextUSMEnqueueMemAdvise (intel#3365) [SYCL][FPGA] Add mutual diagnostic of max_concurrency attribute in conjunction of disable_loop_pipelining attribute (intel#3512) [SYCL] [MATRIX] Enable joint_matrix_load, joint_matrix_store, and joint_matrix_mad for AMX (intel#3503) [ESIMD] Skip rewriting functions used through function pointers (intel#3527) [SYCL] Fix address space for spec constants buffer (intel#3521) [SYCL] Correct the tablegen for checking mutually exclusive stmt attrs (intel#3519) [SYCL][PI][L0][NFC] Refactor setting of LastCommandEvent (intel#3528) [SYCL] Fix group local memory sharing issue (intel#3489) [SYCL][NFC] Fix post-commit failure (intel#3532) [SYCL][Doc] Remove extension mechanism (intel#3526) [SYCL] Move sycl.hpp in install directory and adjust driver to match (intel#3523) [SYCL][ESIMD] Update ESIMD docs to address recent user comments: (intel#3516) [NFCI][SYCL] Correct -fdeclare-spirv-builtins to use marshalling (intel#3515) [SYCL] Rework MarkDevice and children (intel#3475) [SYCL] Fix StringLiteral Ctor issue from intel#3504. (intel#3520) ...
The work that was done upstream turned out to be insufficient for
checking statement attribute mutual exclusion because attributed
statements do not collect their attributes one-at-a-time in the same
way that declarations do. So the design that was attempting to check
for mutual exclusion as each attribute was processed would not ever
catch a mutual exclusion.
The new approach is to check all of attributes that are to be applied
to the attributed statement in a group. This required generating
another DiagnoseMutualExclusions() function into AttrParsedAttrImpl.inc.