[PATCH] D62424: Tests for nosync function attribute.

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 25 12:02:28 PDT 2019


jdoerfert added a comment.

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.



================
Comment at: llvm/test/Transforms/FunctionAttrs/nosync.ll:44
+; CHECK: define dso_local i32 @load_monotonic(i32* nocapture readonly) local_unnamed_addr norecurse nounwind uwtable
+define dso_local i32 @load_monotonic(i32* nocapture readonly) local_unnamed_addr #2 {
+  %2 = load atomic i32, i32* %0 monotonic, align 4
----------------
Remove `the dso_local` and `local_unamed_addr` everywhere


================
Comment at: llvm/test/Transforms/FunctionAttrs/nosync.ll:70
+
+; CHECK: define dso_local i32 @load_acquire(i32* nocapture readonly) local_unnamed_addr norecurse nounwind uwtable
+define dso_local i32 @bar(i32* nocapture readonly) local_unnamed_addr #2 {
----------------
Maybe mention that we should *not* deduce `nosync` in the negative test cases.


================
Comment at: llvm/test/Transforms/FunctionAttrs/nosync.ll:116
+attributes #1 = { nounwind uwtable }
+attributes #2 = { norecurse nounwind uwtable }
----------------
We don't need these


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62424/new/

https://reviews.llvm.org/D62424





More information about the llvm-commits mailing list