Skip to content

Instantly share code, notes, and snippets.

@dmlloyd
Created September 28, 2021 16:18
Show Gist options
  • Save dmlloyd/e963509e8a60811eeb69e2990b10a433 to your computer and use it in GitHub Desktop.
Save dmlloyd/e963509e8a60811eeb69e2990b10a433 to your computer and use it in GitHub Desktop.
Why?
atomicrmw [volatile] <operation> <ty>* <pointer>, <ty> <value> [syncscope("<target-scope>")] <ordering>[, align <alignment>] ; yields ty
<...>
"The instruction can take an optional align attribute. The alignment must be a power of two greater or equal to the size of the <value> type. If unspecified, the alignment is assumed to be equal to the size of the ‘<value>’ type. Note that this default alignment assumption is different from the alignment used for the load/store instructions when align isn’t specified."
$ llc /home/david/src/java/qbicc-test-project/target/native/java/util/concurrent/atomic/AtomicInteger.ll
llc: error: llc: /home/david/src/java/qbicc-test-project/target/native/java/util/concurrent/atomic/AtomicInteger.ll:73:63: error: expected metadata after comma
%L7 = atomicrmw add i32 addrspace(1)* %L6, i32 %p0 acq_rel, align 4, !dbg !15 ; AtomicInteger.java:239 bci@8
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment