From e1052f921c0d845fb6257d1347a97af4e4d8dfd9 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 20 Jun 2022 14:40:35 +0200 Subject: compiler: define atomic intrinsic functions directly This changes the compiler from treating calls to sync/atomic.* functions as special calls (emitted directly at the call site) to actually defining their declarations when there is no Go SSA implementation. And rely on the inliner to inline these very small functions. This works a bit better in practice. For example, this makes it possible to use these functions in deferred function calls. This commit is a bit large because it also needs to refactor a few things to make it possible to define such intrinsic functions. --- testdata/atomic.txt | 1 + 1 file changed, 1 insertion(+) (limited to 'testdata/atomic.txt') diff --git a/testdata/atomic.txt b/testdata/atomic.txt index d1f2ab293..a03f292ce 100644 --- a/testdata/atomic.txt +++ b/testdata/atomic.txt @@ -33,3 +33,4 @@ StoreUint32: 20 StoreUint64: 20 StoreUintptr: 20 StorePointer: true +deferred atomic add: 8 -- cgit v1.2.3