-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mir] Print/Parse both MOLoad and MOStore when they occur together.
Summary: They're not always mutually exclusive. read-modify-write atomics are both at the same time. One example of this is the SWP instructions on AArch64. Another example is GlobalISel's G_ATOMICRMW_* generic instructions which will be added in a later patch. Reviewers: arphaman, aemerson Reviewed By: aemerson Subscribers: aemerson, javed.absar, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D40157 llvm-svn: 319202
- Loading branch information
1 parent
50e6e54
commit 17d277b
Showing
3 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# RUN: llc -mtriple=aarch64-none-linux-gnu -run-pass none -o - %s | FileCheck %s | ||
|
||
--- | | ||
define i32 @swp(i32* %addr) #0 { | ||
entry: | ||
%0 = atomicrmw xchg i32* %addr, i32 1 monotonic | ||
ret i32 %0 | ||
} | ||
|
||
attributes #0 = { "target-features"="+lse" } | ||
... | ||
--- | ||
name: swp | ||
alignment: 2 | ||
tracksRegLiveness: true | ||
registers: | ||
- { id: 0, class: gpr64common } | ||
- { id: 1, class: gpr32 } | ||
- { id: 2, class: gpr32 } | ||
liveins: | ||
- { reg: '%x0', virtual-reg: '%0' } | ||
body: | | ||
bb.0.entry: | ||
liveins: %x0 | ||
; CHECK-LABEL: swp | ||
; CHECK: {{[0-9]+}}:gpr32 = SWPW killed %1, %0 :: (volatile load store monotonic 4 on %ir.addr) | ||
%0:gpr64common = COPY %x0 | ||
%1:gpr32 = MOVi32imm 1 | ||
%2:gpr32 = SWPW killed %1, %0 :: (volatile load store monotonic 4 on %ir.addr) | ||
%w0 = COPY %2 | ||
RET_ReallyLR implicit %w0 | ||
... |