Skip to content

Commit 9a04bc4

Browse files
authored
[AArch64] Move LDR_PXI from isStoreToStackSlot to isLoadFromStackSlot (#65658)
LDR_PXI is a load instruction, so it should be in isLoadFromStackSlot.
1 parent 272bd6f commit 9a04bc4

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

llvm/lib/Target/AArch64/AArch64InstrInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2234,6 +2234,7 @@ unsigned AArch64InstrInfo::isLoadFromStackSlot(const MachineInstr &MI,
22342234
case AArch64::LDRSui:
22352235
case AArch64::LDRDui:
22362236
case AArch64::LDRQui:
2237+
case AArch64::LDR_PXI:
22372238
if (MI.getOperand(0).getSubReg() == 0 && MI.getOperand(1).isFI() &&
22382239
MI.getOperand(2).isImm() && MI.getOperand(2).getImm() == 0) {
22392240
FrameIndex = MI.getOperand(1).getIndex();
@@ -2257,7 +2258,6 @@ unsigned AArch64InstrInfo::isStoreToStackSlot(const MachineInstr &MI,
22572258
case AArch64::STRSui:
22582259
case AArch64::STRDui:
22592260
case AArch64::STRQui:
2260-
case AArch64::LDR_PXI:
22612261
case AArch64::STR_PXI:
22622262
if (MI.getOperand(0).getSubReg() == 0 && MI.getOperand(1).isFI() &&
22632263
MI.getOperand(2).isImm() && MI.getOperand(2).getImm() == 0) {
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; RUN: llc -mtriple=aarch64-linux-gnu -verify-machineinstrs -mattr=+sme -pass-remarks-missed='regalloc' %s -o - 2>&1 | FileCheck %s
2+
3+
; We should have both spill and reload for %arg.
4+
5+
; CHECK: remark: <unknown>:0:0: 2 spills 2.000000e+00 total spills cost 3 reloads 3.000000e+00 total reloads cost generated in function
6+
7+
define <vscale x 2 x i1> @streaming_compatible_with_predicate_vectors(<vscale x 2 x i1> %arg) "aarch64_pstate_sm_compatible" nounwind #0 {
8+
%res = call <vscale x 2 x i1> @normal_callee_predicate_vec_arg(<vscale x 2 x i1> %arg)
9+
%and = and <vscale x 2 x i1> %res, %arg
10+
ret <vscale x 2 x i1> %and
11+
}
12+
13+
declare <vscale x 2 x i1> @normal_callee_predicate_vec_arg(<vscale x 2 x i1>)
14+
15+
attributes #0 = { nounwind "target-features"="+sve" }

0 commit comments

Comments
 (0)