forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PowerPC] Allow llvm.ppc.cfence to accept pointer types
Backport https://reviews.llvm.org/D127554
- Loading branch information
Showing
3 changed files
with
142 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc -opaque-pointers -mtriple=powerpc64le-unknown-unknown < %s | FileCheck %s | ||
; RUN: llc -opaque-pointers -mtriple=powerpc64-unknown-unknown < %s | FileCheck %s | ||
|
||
define void @foo() #0 { | ||
; CHECK-LABEL: foo: | ||
; CHECK: # %bb.0: # %bb0 | ||
; CHECK-NEXT: bc 12, 20, .LBB0_2 | ||
; CHECK-NEXT: # %bb.1: # %bb1 | ||
; CHECK-NEXT: ld 3, 0(3) | ||
; CHECK-NEXT: cmpd 7, 3, 3 | ||
; CHECK-NEXT: bne- 7, .+4 | ||
; CHECK-NEXT: isync | ||
; CHECK-NEXT: .LBB0_2: # %bb2 | ||
bb0: | ||
br i1 undef, label %bb1, label %bb2 | ||
|
||
bb1: | ||
%0 = load atomic {}*, {}** undef acquire, align 8 | ||
unreachable | ||
|
||
bb2: | ||
unreachable | ||
} | ||
|
||
define void @bar() #0 { | ||
; CHECK-LABEL: bar: | ||
; CHECK: # %bb.0: # %bb0 | ||
; CHECK-NEXT: bc 12, 20, .LBB1_2 | ||
; CHECK-NEXT: # %bb.1: # %bb1 | ||
; CHECK-NEXT: ld 3, 0(3) | ||
; CHECK-NEXT: cmpd 7, 3, 3 | ||
; CHECK-NEXT: bne- 7, .+4 | ||
; CHECK-NEXT: isync | ||
; CHECK-NEXT: .LBB1_2: # %bb2 | ||
bb0: | ||
br i1 undef, label %bb1, label %bb2 | ||
|
||
bb1: | ||
%0 = load atomic ptr, ptr undef acquire, align 8 | ||
unreachable | ||
|
||
bb2: | ||
unreachable | ||
} | ||
|
||
define void @foobar() { | ||
; CHECK-LABEL: foobar: | ||
; CHECK: # %bb.0: # %top | ||
; CHECK-NEXT: bc 4, 20, .LBB2_2 | ||
; CHECK-NEXT: # %bb.1: # %err86 | ||
; CHECK-NEXT: .LBB2_2: # %pass9 | ||
; CHECK-NEXT: ld 3, 0(3) | ||
; CHECK-NEXT: cmpd 7, 3, 3 | ||
; CHECK-NEXT: bne- 7, .+4 | ||
; CHECK-NEXT: isync | ||
top: | ||
br i1 undef, label %err86, label %pass9 | ||
|
||
pass9: ; preds = %top | ||
%0 = load atomic {} addrspace(10)*, {} addrspace(10)* addrspace(11)* undef acquire, align 8 | ||
unreachable | ||
|
||
err86: ; preds = %top | ||
unreachable | ||
} |
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,71 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py | ||
; RUN: opt -opaque-pointers -atomic-expand -S -mtriple=powerpc64le-unknown-unknown \ | ||
; RUN: %s | FileCheck %s | ||
; RUN: opt -opaque-pointers -atomic-expand -S -mtriple=powerpc64-unknown-unknown \ | ||
; RUN: %s | FileCheck %s | ||
|
||
define void @foo() #0 { | ||
; CHECK-LABEL: @foo( | ||
; CHECK-NEXT: bb0: | ||
; CHECK-NEXT: br i1 undef, label [[BB1:%.*]], label [[BB2:%.*]] | ||
; CHECK: bb1: | ||
; CHECK-NEXT: [[TMP0:%.*]] = load atomic ptr, ptr undef monotonic, align 8 | ||
; CHECK-NEXT: call void @llvm.ppc.cfence.p0(ptr [[TMP0]]) | ||
; CHECK-NEXT: unreachable | ||
; CHECK: bb2: | ||
; CHECK-NEXT: unreachable | ||
; | ||
bb0: | ||
br i1 undef, label %bb1, label %bb2 | ||
|
||
bb1: | ||
%0 = load atomic {}*, {}** undef acquire, align 8 | ||
unreachable | ||
|
||
bb2: | ||
unreachable | ||
} | ||
|
||
define void @bar() #0 { | ||
; CHECK-LABEL: @bar( | ||
; CHECK-NEXT: bb0: | ||
; CHECK-NEXT: br i1 undef, label [[BB1:%.*]], label [[BB2:%.*]] | ||
; CHECK: bb1: | ||
; CHECK-NEXT: [[TMP0:%.*]] = load atomic ptr, ptr undef monotonic, align 8 | ||
; CHECK-NEXT: call void @llvm.ppc.cfence.p0(ptr [[TMP0]]) | ||
; CHECK-NEXT: unreachable | ||
; CHECK: bb2: | ||
; CHECK-NEXT: unreachable | ||
; | ||
bb0: | ||
br i1 undef, label %bb1, label %bb2 | ||
|
||
bb1: | ||
%0 = load atomic ptr, ptr undef acquire, align 8 | ||
unreachable | ||
|
||
bb2: | ||
unreachable | ||
} | ||
|
||
define void @foobar() { | ||
; CHECK-LABEL: @foobar( | ||
; CHECK-NEXT: top: | ||
; CHECK-NEXT: br i1 undef, label [[ERR86:%.*]], label [[PASS9:%.*]] | ||
; CHECK: pass9: | ||
; CHECK-NEXT: [[TMP0:%.*]] = load atomic ptr addrspace(10), ptr addrspace(11) undef monotonic, align 8 | ||
; CHECK-NEXT: call void @llvm.ppc.cfence.p10(ptr addrspace(10) [[TMP0]]) | ||
; CHECK-NEXT: unreachable | ||
; CHECK: err86: | ||
; CHECK-NEXT: unreachable | ||
; | ||
top: | ||
br i1 undef, label %err86, label %pass9 | ||
|
||
pass9: ; preds = %top | ||
%0 = load atomic {} addrspace(10)*, {} addrspace(10)* addrspace(11)* undef acquire, align 8 | ||
unreachable | ||
|
||
err86: ; preds = %top | ||
unreachable | ||
} |