forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from androm3da/rustc/10.0-2020-02-05
Handle part-word LL/SC in atomic expansion pass
- Loading branch information
Showing
8 changed files
with
322 additions
and
145 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,22 @@ | ||
; RUN: llc -march=hexagon < %s | FileCheck %s | ||
|
||
; CHECK: .LBB0_1: | ||
; CHECK: [[R1:r[0-9]+]] = memw_locked(r0) | ||
; CHECK-DAG: [[R2:r[0-9]+]] = and([[R1]], | ||
; CHECK-DAG: [[R3:r[0-9]+]] = add([[R1]], | ||
; CHECK: [[R2]] |= and([[R3]], | ||
; CHECK: memw_locked(r0,[[P0:p[0-3]]]) = [[R2]] | ||
; CHECK: if (![[P0]]) jump:nt .LBB0_1 | ||
|
||
|
||
%struct.a = type { i8 } | ||
|
||
define void @b() #0 { | ||
%d = alloca %struct.a | ||
%c = getelementptr %struct.a, %struct.a* %d, i32 0, i32 0 | ||
atomicrmw add i8* %c, i8 2 monotonic | ||
ret void | ||
} | ||
|
||
attributes #0 = { "target-cpu"="hexagonv66" } | ||
|
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,28 @@ | ||
; RUN: llc -march=hexagon < %s | FileCheck %s | ||
|
||
; CHECK-LABEL: danny | ||
; CHECK: memw_locked | ||
define i8 @danny(i8* %a0) unnamed_addr #0 { | ||
start: | ||
%v0 = cmpxchg i8* %a0, i8 0, i8 1 seq_cst seq_cst | ||
%v1 = extractvalue { i8, i1 } %v0, 0 | ||
ret i8 %v1 | ||
} | ||
|
||
; CHECK-LABEL: sammy | ||
; CHECK: memw_locked | ||
define i16 @sammy(i16* %a0) unnamed_addr #0 { | ||
start: | ||
%v0 = cmpxchg i16* %a0, i16 0, i16 1 seq_cst seq_cst | ||
%v1 = extractvalue { i16, i1 } %v0, 0 | ||
ret i16 %v1 | ||
} | ||
|
||
; CHECK-LABEL: kirby | ||
; CHECK: memw_locked | ||
define i32 @kirby(i32* %a0) unnamed_addr #0 { | ||
start: | ||
%v0 = cmpxchg i32* %a0, i32 0, i32 1 seq_cst seq_cst | ||
%v1 = extractvalue { i32, i1 } %v0, 0 | ||
ret i32 %v1 | ||
} |
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
Oops, something went wrong.