This commit is test for upcoming patch on nosync attribute deduction
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 33038 Build 33037: arc lint + arc unit
Event Timeline
Some comments inlined. Please also add:
- SCC tests with multiple functions calling each other. You don't need them for all kinds of sync operations but a positive and a negative test with volatile would be good.
- Test with calls to declared functions. Positive (with nosync attribute present) and negative again.
llvm/test/Transforms/FunctionAttrs/nosync.ll | ||
---|---|---|
45 | Remove the dso_local and local_unamed_addr everywhere | |
71 | Maybe mention that we should *not* deduce nosync in the negative test cases. | |
117 | We don't need these |
Addressed most of the comments.
What can be the positive case for SCC tests with volatile? Isn't volatile always supposed to sync?
llvm/test/Transforms/FunctionAttrs/nosync.ll | ||
---|---|---|
71 | Add a | |
117 | FIXME: nosync missing We should be able to pass the test right now so we can integrate it already. |
I'm now also unsure if a Release build will print the definitions are you check for them, that is the attributes listed at the end.
I think the form below should always work.
; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-NEXT: define void @scc2(i32*)
llvm/test/Transforms/FunctionAttrs/nosync.ll | ||
---|---|---|
76 | This is my bad but I think the combination of my prior to requests will not work. Could you see if ; CHECK: Function Attrs: norecurse nounwind uwtable ; CHECK-NOT: nosync ; CHECK-NEXT: define i32 @load_acquire(i32* nocapture readonly) works and if not remove the NEXT part. |
- Fixed tests. Removed some 'CHECK-NEXT' directives.
- Test now passing.
CHECK-NEXT was the problem in TEST 8 & 9 so I removed it only from those two. Is that ok?
nosync.ll:130:15: error: CHECK-NEXT: is not on the line after the previous match ; CHECK-NEXT: define void @call_nosync_function() ^ <stdin>:55:1: note: 'next' match was here define void @call_nosync_function() #2 { ^ <stdin>:51:44: note: previous match ended here ; Function Attrs: noinline nounwind uwtable ^ <stdin>:52:1: note: non-matching line after previous match is here declare void @nosync_function() #2 ^
Good thing we looked into this. You should look at the IR output (without lit) to see what the problem is but I would assume the decleration of nosync_function is placed before call_nosync_function. Then, the CHECK line you added for the attributes of the latter actually matches the attributes of the former. That would mean, adding another check line for the former, including the check-not nosync, will fix the issue and check-next will do what we want.
Remove the dso_local and local_unamed_addr everywhere