Closed gitoleg closed 1 month ago
But as far as I see I can use the existing AtomicFetch instead. Is it correct?
Yep!
@bcardosolopes done
Can you also please add more tests like the ones for __sync_fetch_and_add in clang/test/CodeGen/Atomics.c?
I added more tests for different types . Or .. You meant we need to create another file for some reasons?
I added more tests for different types . Or .. You meant we need to create another file for some reasons?
This is fine, thanks!
This is still missing checks for the LLVM counterparts for the new ones you added, I'd like to make sure we are emitting the same code as OG codegen
@bcardosolopes updated!
This PR adds support for atomic
__sync_fetch_and_add
.Basically it's a copy-pasta from the original
codegen
. The only thing that I doubt about is what exact operation I need to create in CIR. The first approach I used was to createAtomicRMW
operation in CIR. But as far as I see I can use the existingAtomicFetch
instead. Is it correct? or it's better to add a new op here?