diff options
author | Archibald Elliott <archibald.elliott@arm.com> | 2022-12-07 10:04:30 +0000 |
---|---|---|
committer | Archibald Elliott <archibald.elliott@arm.com> | 2022-12-16 14:42:27 +0000 |
commit | 82b51a14280414a53413ed62c001d2c589c649c3 (patch) | |
tree | 4f0a241f025d80eff06abdbb261267cf7dc19b10 /clang/test/CodeGen/arm_acle.c | |
parent | f86cdb4853618603b8889dfeb932fd4ef8efd010 (diff) | |
download | llvm-82b51a14280414a53413ed62c001d2c589c649c3.zip llvm-82b51a14280414a53413ed62c001d2c589c649c3.tar.gz llvm-82b51a14280414a53413ed62c001d2c589c649c3.tar.bz2 |
[AArch64] Support SLC in ACLE prefetch intrinsics
This change:
- Modifies the ACLE code to allow the new SLC value (3) for the prefetch
target.
- Introduces a new intrinsic, @llvm.aarch64.prefetch which matches the
PRFM family instructions much more closely, and can represent all
values for the PRFM immediate.
The target-independent @llvm.prefetch intrinsic does not have enough
information for us to be able to lower to it from the ACLE intrinsics
correctly.
- Lowers the acle calls to the new intrinsic on aarch64 (the ARM
lowering is unchanged).
- Implements code generation for the new intrinsic in both SelectionDAG
and GlobalISel. We specifically choose to continue to support lowering
the target-independent @llvm.prefetch intrinsic so that other
frontends can continue to use it.
Differential Revision: https://reviews.llvm.org/D139443
Diffstat (limited to 'clang/test/CodeGen/arm_acle.c')
-rw-r--r-- | clang/test/CodeGen/arm_acle.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/clang/test/CodeGen/arm_acle.c b/clang/test/CodeGen/arm_acle.c index 3697d29..d3ea9de 100644 --- a/clang/test/CodeGen/arm_acle.c +++ b/clang/test/CodeGen/arm_acle.c @@ -168,10 +168,15 @@ void test_swp(uint32_t x, volatile void *p) { /* 8.6 Memory prefetch intrinsics */ /* 8.6.1 Data prefetch */ -// ARM-LABEL: @test_pld( -// ARM-NEXT: entry: -// ARM-NEXT: call void @llvm.prefetch.p0(ptr null, i32 0, i32 3, i32 1) -// ARM-NEXT: ret void +// AArch32-LABEL: @test_pld( +// AArch32-NEXT: entry: +// AArch32-NEXT: call void @llvm.prefetch.p0(ptr null, i32 0, i32 3, i32 1) +// AArch32-NEXT: ret void +// +// AArch64-LABEL: @test_pld( +// AArch64-NEXT: entry: +// AArch64-NEXT: call void @llvm.aarch64.prefetch(ptr null, i32 0, i32 0, i32 0, i32 1) +// AArch64-NEXT: ret void // void test_pld() { __pld(0); @@ -184,7 +189,7 @@ void test_pld() { // // AArch64-LABEL: @test_pldx( // AArch64-NEXT: entry: -// AArch64-NEXT: call void @llvm.prefetch.p0(ptr null, i32 1, i32 1, i32 1) +// AArch64-NEXT: call void @llvm.aarch64.prefetch(ptr null, i32 1, i32 2, i32 0, i32 1) // AArch64-NEXT: ret void // void test_pldx() { @@ -192,10 +197,15 @@ void test_pldx() { } /* 8.6.2 Instruction prefetch */ -// ARM-LABEL: @test_pli( -// ARM-NEXT: entry: -// ARM-NEXT: call void @llvm.prefetch.p0(ptr null, i32 0, i32 3, i32 0) -// ARM-NEXT: ret void +// AArch32-LABEL: @test_pli( +// AArch32-NEXT: entry: +// AArch32-NEXT: call void @llvm.prefetch.p0(ptr null, i32 0, i32 3, i32 0) +// AArch32-NEXT: ret void +// +// AArch64-LABEL: @test_pli( +// AArch64-NEXT: entry: +// AArch64-NEXT: call void @llvm.aarch64.prefetch(ptr null, i32 0, i32 0, i32 0, i32 0) +// AArch64-NEXT: ret void // void test_pli() { __pli(0); @@ -208,7 +218,7 @@ void test_pli() { // // AArch64-LABEL: @test_plix( // AArch64-NEXT: entry: -// AArch64-NEXT: call void @llvm.prefetch.p0(ptr null, i32 0, i32 1, i32 0) +// AArch64-NEXT: call void @llvm.aarch64.prefetch(ptr null, i32 0, i32 2, i32 0, i32 0) // AArch64-NEXT: ret void // void test_plix() { |