[llvm] r314319 - [AArch64][Falkor] Ignore SP based loads in HW prefetch fixups.
Geoff Berry via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 27 10:14:10 PDT 2017
Author: gberry
Date: Wed Sep 27 10:14:10 2017
New Revision: 314319
URL: http://llvm.org/viewvc/llvm-project?rev=314319&view=rev
Log:
[AArch64][Falkor] Ignore SP based loads in HW prefetch fixups.
Reviewers: mcrosier
Subscribers: aemerson, rengolin, javed.absar, kristof.beyls
Differential Revision: https://reviews.llvm.org/D38301
Modified:
llvm/trunk/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp
llvm/trunk/test/CodeGen/AArch64/falkor-hwpf-fix.mir
Modified: llvm/trunk/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp?rev=314319&r1=314318&r2=314319&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp Wed Sep 27 10:14:10 2017
@@ -638,9 +638,14 @@ static Optional<LoadInfo> getLoadInfo(co
break;
}
+ // Loads from the stack pointer don't get prefetched.
+ unsigned BaseReg = MI.getOperand(BaseRegIdx).getReg();
+ if (BaseReg == AArch64::SP || BaseReg == AArch64::WSP)
+ return None;
+
LoadInfo LI;
LI.DestReg = DestRegIdx == -1 ? 0 : MI.getOperand(DestRegIdx).getReg();
- LI.BaseReg = MI.getOperand(BaseRegIdx).getReg();
+ LI.BaseReg = BaseReg;
LI.BaseRegIdx = BaseRegIdx;
LI.OffsetOpnd = OffsetIdx == -1 ? nullptr : &MI.getOperand(OffsetIdx);
LI.IsPrePost = IsPrePost;
Modified: llvm/trunk/test/CodeGen/AArch64/falkor-hwpf-fix.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/falkor-hwpf-fix.mir?rev=314319&r1=314318&r2=314319&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/falkor-hwpf-fix.mir (original)
+++ llvm/trunk/test/CodeGen/AArch64/falkor-hwpf-fix.mir Wed Sep 27 10:14:10 2017
@@ -330,3 +330,26 @@ body: |
bb.1:
RET_ReallyLR
...
+---
+# Check that we treat sp based loads as non-prefetching.
+
+# CHECK-LABEL: name: hwpf_spbase
+# CHECK-NOT: ORRXrs %xzr
+# CHECK: LDRWui %x15
+# CHECK: LDRWui %sp
+name: hwpf_spbase
+tracksRegLiveness: true
+body: |
+ bb.0:
+ liveins: %w0, %x15
+
+ %w1 = LDRWui %x15, 0 :: ("aarch64-strided-access" load 4)
+ %w17 = LDRWui %sp, 0
+
+ %w0 = SUBWri %w0, 1, 0
+ %wzr = SUBSWri %w0, 0, 0, implicit-def %nzcv
+ Bcc 9, %bb.0, implicit %nzcv
+
+ bb.1:
+ RET_ReallyLR
+...
More information about the llvm-commits
mailing list