[PATCH] D104349: [compiler-rt][atomics] Add `restrict` modifier to pointer arguments
    Kai Luo via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Jul  1 02:58:58 PDT 2021
    
    
  
lkail updated this revision to Diff 355811.
lkail retitled this revision from "[compiler-rt][atomics][RFC] Enable __atomic_exchange handling case when `val == old`" to "[compiler-rt][atomics] Add `restrict` modifier to pointer arguments".
lkail edited the summary of this revision.
lkail added a comment.
Following @theraven 's suggestion.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104349/new/
https://reviews.llvm.org/D104349
Files:
  compiler-rt/lib/builtins/atomic.c
Index: compiler-rt/lib/builtins/atomic.c
===================================================================
--- compiler-rt/lib/builtins/atomic.c
+++ compiler-rt/lib/builtins/atomic.c
@@ -225,8 +225,10 @@
 }
 
 /// Performs an atomic exchange operation between two pointers.  This is atomic
-/// with respect to the target address.
-void __atomic_exchange_c(int size, void *ptr, void *val, void *old, int model) {
+/// with respect to the target address. ptr, val and old should not alias each
+/// other.
+void __atomic_exchange_c(int size, void *restrict ptr, void *restrict val,
+                         void *restrict old, int model) {
 #define LOCK_FREE_ACTION(type)                                                 \
   *(type *)old =                                                               \
       __c11_atomic_exchange((_Atomic(type) *)ptr, *(type *)val, model);        \
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104349.355811.patch
Type: text/x-patch
Size: 888 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210701/d0dfd1fd/attachment.bin>
    
    
More information about the llvm-commits
mailing list