Skip to content

Commit b0ffaa7

Browse files
[AArch64] Prevent the AArch64LoadStoreOptimizer from reordering CFI instructions (#101317)
When AArch64LoadStoreOptimizer pass merges an SP update with a load/store instruction and needs to adjust unwind information either: * create the merged instruction at the location of the SP update (so no CFI instructions are moved), or * only move a CFI instruction if the move would not reorder it across other CFI instructions If neither of the above is possible, don't perform the optimisation.
1 parent 6a56f15 commit b0ffaa7

12 files changed

+558
-67
lines changed

llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp

Lines changed: 79 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,12 @@ struct AArch64LoadStoreOpt : public MachineFunctionPass {
190190
// Scan the instruction list to find a base register update that can
191191
// be combined with the current instruction (a load or store) using
192192
// pre or post indexed addressing with writeback. Scan backwards.
193+
// `MergeEither` is set to true if the combined instruction may be placed
194+
// either at the location of the load/store instruction or at the location of
195+
// the update intruction.
193196
MachineBasicBlock::iterator
194-
findMatchingUpdateInsnBackward(MachineBasicBlock::iterator I, unsigned Limit);
197+
findMatchingUpdateInsnBackward(MachineBasicBlock::iterator I, unsigned Limit,
198+
bool &MergeEither);
195199

196200
// Find an instruction that updates the base register of the ld/st
197201
// instruction.
@@ -202,9 +206,10 @@ struct AArch64LoadStoreOpt : public MachineFunctionPass {
202206
unsigned IndexReg, unsigned &Offset);
203207

204208
// Merge a pre- or post-index base register update into a ld/st instruction.
205-
MachineBasicBlock::iterator
209+
std::optional<MachineBasicBlock::iterator>
206210
mergeUpdateInsn(MachineBasicBlock::iterator I,
207-
MachineBasicBlock::iterator Update, bool IsPreIdx);
211+
MachineBasicBlock::iterator Update, bool IsForward,
212+
bool IsPreIdx, bool MergeEither);
208213

209214
MachineBasicBlock::iterator
210215
mergeConstOffsetInsn(MachineBasicBlock::iterator I,
@@ -2070,20 +2075,37 @@ maybeMoveCFI(MachineInstr &MI, MachineBasicBlock::iterator MaybeCFI) {
20702075
}
20712076
}
20722077

2073-
MachineBasicBlock::iterator
2074-
AArch64LoadStoreOpt::mergeUpdateInsn(MachineBasicBlock::iterator I,
2075-
MachineBasicBlock::iterator Update,
2076-
bool IsPreIdx) {
2078+
std::optional<MachineBasicBlock::iterator> AArch64LoadStoreOpt::mergeUpdateInsn(
2079+
MachineBasicBlock::iterator I, MachineBasicBlock::iterator Update,
2080+
bool IsForward, bool IsPreIdx, bool MergeEither) {
20772081
assert((Update->getOpcode() == AArch64::ADDXri ||
20782082
Update->getOpcode() == AArch64::SUBXri) &&
20792083
"Unexpected base register update instruction to merge!");
20802084
MachineBasicBlock::iterator E = I->getParent()->end();
20812085
MachineBasicBlock::iterator NextI = next_nodbg(I, E);
20822086

2083-
// If updating the SP and the following instruction is CFA offset related CFI
2084-
// instruction move it after the merged instruction.
2085-
MachineBasicBlock::iterator CFI =
2086-
IsPreIdx ? maybeMoveCFI(*Update, next_nodbg(Update, E)) : E;
2087+
// If updating the SP and the following instruction is CFA offset related CFI,
2088+
// make sure the CFI follows the SP update either by merging at the location
2089+
// of the update or by moving the CFI after the merged instruction. If unable
2090+
// to do so, bail.
2091+
MachineBasicBlock::iterator InsertPt = I;
2092+
if (IsForward) {
2093+
assert(IsPreIdx);
2094+
if (auto CFI = maybeMoveCFI(*Update, next_nodbg(Update, E)); CFI != E) {
2095+
if (MergeEither) {
2096+
InsertPt = Update;
2097+
} else {
2098+
// Take care not to reorder CFIs.
2099+
if (std::any_of(std::next(CFI), I, [](const auto &Insn) {
2100+
return Insn.getOpcode() == TargetOpcode::CFI_INSTRUCTION;
2101+
}))
2102+
return std::nullopt;
2103+
2104+
MachineBasicBlock *MBB = InsertPt->getParent();
2105+
MBB->splice(std::next(InsertPt), MBB, CFI);
2106+
}
2107+
}
2108+
}
20872109

20882110
// Return the instruction following the merged instruction, which is
20892111
// the instruction following our unmerged load. Unless that's the add/sub
@@ -2104,7 +2126,8 @@ AArch64LoadStoreOpt::mergeUpdateInsn(MachineBasicBlock::iterator I,
21042126
getPrePostIndexedMemOpInfo(*I, Scale, MinOffset, MaxOffset);
21052127
if (!AArch64InstrInfo::isPairedLdSt(*I)) {
21062128
// Non-paired instruction.
2107-
MIB = BuildMI(*I->getParent(), I, I->getDebugLoc(), TII->get(NewOpc))
2129+
MIB = BuildMI(*InsertPt->getParent(), InsertPt, InsertPt->getDebugLoc(),
2130+
TII->get(NewOpc))
21082131
.add(Update->getOperand(0))
21092132
.add(getLdStRegOp(*I))
21102133
.add(AArch64InstrInfo::getLdStBaseOp(*I))
@@ -2113,7 +2136,8 @@ AArch64LoadStoreOpt::mergeUpdateInsn(MachineBasicBlock::iterator I,
21132136
.setMIFlags(I->mergeFlagsWith(*Update));
21142137
} else {
21152138
// Paired instruction.
2116-
MIB = BuildMI(*I->getParent(), I, I->getDebugLoc(), TII->get(NewOpc))
2139+
MIB = BuildMI(*InsertPt->getParent(), InsertPt, InsertPt->getDebugLoc(),
2140+
TII->get(NewOpc))
21172141
.add(Update->getOperand(0))
21182142
.add(getLdStRegOp(*I, 0))
21192143
.add(getLdStRegOp(*I, 1))
@@ -2122,10 +2146,6 @@ AArch64LoadStoreOpt::mergeUpdateInsn(MachineBasicBlock::iterator I,
21222146
.setMemRefs(I->memoperands())
21232147
.setMIFlags(I->mergeFlagsWith(*Update));
21242148
}
2125-
if (CFI != E) {
2126-
MachineBasicBlock *MBB = I->getParent();
2127-
MBB->splice(std::next(MIB.getInstr()->getIterator()), MBB, CFI);
2128-
}
21292149

21302150
if (IsPreIdx) {
21312151
++NumPreFolded;
@@ -2360,7 +2380,7 @@ MachineBasicBlock::iterator AArch64LoadStoreOpt::findMatchingUpdateInsnForward(
23602380
}
23612381

23622382
MachineBasicBlock::iterator AArch64LoadStoreOpt::findMatchingUpdateInsnBackward(
2363-
MachineBasicBlock::iterator I, unsigned Limit) {
2383+
MachineBasicBlock::iterator I, unsigned Limit, bool &MergeEither) {
23642384
MachineBasicBlock::iterator B = I->getParent()->begin();
23652385
MachineBasicBlock::iterator E = I->getParent()->end();
23662386
MachineInstr &MemMI = *I;
@@ -2370,19 +2390,21 @@ MachineBasicBlock::iterator AArch64LoadStoreOpt::findMatchingUpdateInsnBackward(
23702390
Register BaseReg = AArch64InstrInfo::getLdStBaseOp(MemMI).getReg();
23712391
int Offset = AArch64InstrInfo::getLdStOffsetOp(MemMI).getImm();
23722392

2393+
bool IsPairedInsn = AArch64InstrInfo::isPairedLdSt(MemMI);
2394+
Register DestReg[] = {getLdStRegOp(MemMI, 0).getReg(),
2395+
IsPairedInsn ? getLdStRegOp(MemMI, 1).getReg()
2396+
: AArch64::NoRegister};
2397+
23732398
// If the load/store is the first instruction in the block, there's obviously
23742399
// not any matching update. Ditto if the memory offset isn't zero.
23752400
if (MBBI == B || Offset != 0)
23762401
return E;
23772402
// If the base register overlaps a destination register, we can't
23782403
// merge the update.
23792404
if (!isTagStore(MemMI)) {
2380-
bool IsPairedInsn = AArch64InstrInfo::isPairedLdSt(MemMI);
2381-
for (unsigned i = 0, e = IsPairedInsn ? 2 : 1; i != e; ++i) {
2382-
Register DestReg = getLdStRegOp(MemMI, i).getReg();
2383-
if (DestReg == BaseReg || TRI->isSubRegister(BaseReg, DestReg))
2405+
for (unsigned i = 0, e = IsPairedInsn ? 2 : 1; i != e; ++i)
2406+
if (DestReg[i] == BaseReg || TRI->isSubRegister(BaseReg, DestReg[i]))
23842407
return E;
2385-
}
23862408
}
23872409

23882410
const bool BaseRegSP = BaseReg == AArch64::SP;
@@ -2403,6 +2425,7 @@ MachineBasicBlock::iterator AArch64LoadStoreOpt::findMatchingUpdateInsnBackward(
24032425
UsedRegUnits.clear();
24042426
unsigned Count = 0;
24052427
bool MemAcessBeforeSPPreInc = false;
2428+
MergeEither = true;
24062429
do {
24072430
MBBI = prev_nodbg(MBBI, B);
24082431
MachineInstr &MI = *MBBI;
@@ -2429,6 +2452,20 @@ MachineBasicBlock::iterator AArch64LoadStoreOpt::findMatchingUpdateInsnBackward(
24292452
if (!ModifiedRegUnits.available(BaseReg) ||
24302453
!UsedRegUnits.available(BaseReg))
24312454
return E;
2455+
2456+
// If we have a destination register (i.e. a load instruction) and a
2457+
// destination register is used or modified, then we can only merge forward,
2458+
// i.e. the combined instruction is put in the place of the memory
2459+
// instruction. Same applies if we see a memory access or side effects.
2460+
if (MI.mayLoadOrStore() || MI.hasUnmodeledSideEffects() ||
2461+
(DestReg[0] != AArch64::NoRegister &&
2462+
!(ModifiedRegUnits.available(DestReg[0]) &&
2463+
UsedRegUnits.available(DestReg[0]))) ||
2464+
(DestReg[1] != AArch64::NoRegister &&
2465+
!(ModifiedRegUnits.available(DestReg[1]) &&
2466+
UsedRegUnits.available(DestReg[1]))))
2467+
MergeEither = false;
2468+
24322469
// Keep track if we have a memory access before an SP pre-increment, in this
24332470
// case we need to validate later that the update amount respects the red
24342471
// zone.
@@ -2639,8 +2676,12 @@ bool AArch64LoadStoreOpt::tryToMergeLdStUpdate
26392676
Update = findMatchingUpdateInsnForward(MBBI, 0, UpdateLimit);
26402677
if (Update != E) {
26412678
// Merge the update into the ld/st.
2642-
MBBI = mergeUpdateInsn(MBBI, Update, /*IsPreIdx=*/false);
2643-
return true;
2679+
if (auto NextI = mergeUpdateInsn(MBBI, Update, /*IsForward=*/false,
2680+
/*IsPreIdx=*/false,
2681+
/*MergeEither=*/false)) {
2682+
MBBI = *NextI;
2683+
return true;
2684+
}
26442685
}
26452686

26462687
// Don't know how to handle unscaled pre/post-index versions below, so bail.
@@ -2652,11 +2693,15 @@ bool AArch64LoadStoreOpt::tryToMergeLdStUpdate
26522693
// ldr x1, [x0]
26532694
// merged into:
26542695
// ldr x1, [x0, #8]!
2655-
Update = findMatchingUpdateInsnBackward(MBBI, UpdateLimit);
2696+
bool MergeEither;
2697+
Update = findMatchingUpdateInsnBackward(MBBI, UpdateLimit, MergeEither);
26562698
if (Update != E) {
26572699
// Merge the update into the ld/st.
2658-
MBBI = mergeUpdateInsn(MBBI, Update, /*IsPreIdx=*/true);
2659-
return true;
2700+
if (auto NextI = mergeUpdateInsn(MBBI, Update, /*IsForward=*/true,
2701+
/*IsPreIdx=*/true, MergeEither)) {
2702+
MBBI = *NextI;
2703+
return true;
2704+
}
26602705
}
26612706

26622707
// The immediate in the load/store is scaled by the size of the memory
@@ -2673,8 +2718,12 @@ bool AArch64LoadStoreOpt::tryToMergeLdStUpdate
26732718
Update = findMatchingUpdateInsnForward(MBBI, UnscaledOffset, UpdateLimit);
26742719
if (Update != E) {
26752720
// Merge the update into the ld/st.
2676-
MBBI = mergeUpdateInsn(MBBI, Update, /*IsPreIdx=*/true);
2677-
return true;
2721+
if (auto NextI = mergeUpdateInsn(MBBI, Update, /*IsForward=*/false,
2722+
/*IsPreIdx=*/true,
2723+
/*MergeEither=*/false)) {
2724+
MBBI = *NextI;
2725+
return true;
2726+
}
26782727
}
26792728

26802729
return false;

llvm/test/CodeGen/AArch64/build-one-lane.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ define void @v2f64st(ptr %p, double %s) nounwind {
318318
define <32 x i8> @test_lanex_32xi8(<32 x i8> %a, i32 %x) {
319319
; CHECK-LABEL: test_lanex_32xi8:
320320
; CHECK: // %bb.0:
321-
; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
322321
; CHECK-NEXT: stp q0, q1, [sp, #-32]!
323322
; CHECK-NEXT: .cfi_def_cfa_offset 32
323+
; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
324324
; CHECK-NEXT: and x8, x0, #0x1f
325325
; CHECK-NEXT: mov x9, sp
326326
; CHECK-NEXT: mov w10, #30 // =0x1e

llvm/test/CodeGen/AArch64/insertextract.ll

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ entry:
160160
define <4 x double> @insert_v4f64_c(<4 x double> %a, double %b, i32 %c) {
161161
; CHECK-SD-LABEL: insert_v4f64_c:
162162
; CHECK-SD: // %bb.0: // %entry
163-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
164163
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
165164
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
165+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
166166
; CHECK-SD-NEXT: and x8, x0, #0x3
167167
; CHECK-SD-NEXT: mov x9, sp
168168
; CHECK-SD-NEXT: str d2, [x9, x8, lsl #3]
@@ -387,9 +387,9 @@ entry:
387387
define <8 x float> @insert_v8f32_c(<8 x float> %a, float %b, i32 %c) {
388388
; CHECK-SD-LABEL: insert_v8f32_c:
389389
; CHECK-SD: // %bb.0: // %entry
390-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
391390
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
392391
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
392+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
393393
; CHECK-SD-NEXT: and x8, x0, #0x7
394394
; CHECK-SD-NEXT: mov x9, sp
395395
; CHECK-SD-NEXT: str s2, [x9, x8, lsl #2]
@@ -552,9 +552,9 @@ entry:
552552
define <16 x half> @insert_v16f16_c(<16 x half> %a, half %b, i32 %c) {
553553
; CHECK-SD-LABEL: insert_v16f16_c:
554554
; CHECK-SD: // %bb.0: // %entry
555-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
556555
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
557556
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
557+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
558558
; CHECK-SD-NEXT: and x8, x0, #0xf
559559
; CHECK-SD-NEXT: mov x9, sp
560560
; CHECK-SD-NEXT: str h2, [x9, x8, lsl #1]
@@ -715,9 +715,9 @@ entry:
715715
define <32 x i8> @insert_v32i8_c(<32 x i8> %a, i8 %b, i32 %c) {
716716
; CHECK-SD-LABEL: insert_v32i8_c:
717717
; CHECK-SD: // %bb.0: // %entry
718-
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
719718
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
720719
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
720+
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
721721
; CHECK-SD-NEXT: and x8, x1, #0x1f
722722
; CHECK-SD-NEXT: mov x9, sp
723723
; CHECK-SD-NEXT: strb w0, [x9, x8]
@@ -876,9 +876,9 @@ entry:
876876
define <16 x i16> @insert_v16i16_c(<16 x i16> %a, i16 %b, i32 %c) {
877877
; CHECK-SD-LABEL: insert_v16i16_c:
878878
; CHECK-SD: // %bb.0: // %entry
879-
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
880879
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
881880
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
881+
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
882882
; CHECK-SD-NEXT: and x8, x1, #0xf
883883
; CHECK-SD-NEXT: mov x9, sp
884884
; CHECK-SD-NEXT: strh w0, [x9, x8, lsl #1]
@@ -1103,9 +1103,9 @@ entry:
11031103
define <8 x i32> @insert_v8i32_c(<8 x i32> %a, i32 %b, i32 %c) {
11041104
; CHECK-SD-LABEL: insert_v8i32_c:
11051105
; CHECK-SD: // %bb.0: // %entry
1106-
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
11071106
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
11081107
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1108+
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
11091109
; CHECK-SD-NEXT: and x8, x1, #0x7
11101110
; CHECK-SD-NEXT: mov x9, sp
11111111
; CHECK-SD-NEXT: str w0, [x9, x8, lsl #2]
@@ -1288,9 +1288,9 @@ entry:
12881288
define <4 x i64> @insert_v4i64_c(<4 x i64> %a, i64 %b, i32 %c) {
12891289
; CHECK-SD-LABEL: insert_v4i64_c:
12901290
; CHECK-SD: // %bb.0: // %entry
1291-
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
12921291
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
12931292
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1293+
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
12941294
; CHECK-SD-NEXT: and x8, x1, #0x3
12951295
; CHECK-SD-NEXT: mov x9, sp
12961296
; CHECK-SD-NEXT: str x0, [x9, x8, lsl #3]
@@ -1454,9 +1454,9 @@ entry:
14541454
define double @extract_v4f64_c(<4 x double> %a, i32 %c) {
14551455
; CHECK-SD-LABEL: extract_v4f64_c:
14561456
; CHECK-SD: // %bb.0: // %entry
1457-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
14581457
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
14591458
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1459+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
14601460
; CHECK-SD-NEXT: and x8, x0, #0x3
14611461
; CHECK-SD-NEXT: mov x9, sp
14621462
; CHECK-SD-NEXT: ldr d0, [x9, x8, lsl #3]
@@ -1662,9 +1662,9 @@ entry:
16621662
define float @extract_v8f32_c(<8 x float> %a, i32 %c) {
16631663
; CHECK-SD-LABEL: extract_v8f32_c:
16641664
; CHECK-SD: // %bb.0: // %entry
1665-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
16661665
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
16671666
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1667+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
16681668
; CHECK-SD-NEXT: and x8, x0, #0x7
16691669
; CHECK-SD-NEXT: mov x9, sp
16701670
; CHECK-SD-NEXT: ldr s0, [x9, x8, lsl #2]
@@ -1821,9 +1821,9 @@ entry:
18211821
define half @extract_v16f16_c(<16 x half> %a, i32 %c) {
18221822
; CHECK-SD-LABEL: extract_v16f16_c:
18231823
; CHECK-SD: // %bb.0: // %entry
1824-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
18251824
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
18261825
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1826+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
18271827
; CHECK-SD-NEXT: and x8, x0, #0xf
18281828
; CHECK-SD-NEXT: mov x9, sp
18291829
; CHECK-SD-NEXT: ldr h0, [x9, x8, lsl #1]
@@ -1979,9 +1979,9 @@ entry:
19791979
define i8 @extract_v32i8_c(<32 x i8> %a, i32 %c) {
19801980
; CHECK-SD-LABEL: extract_v32i8_c:
19811981
; CHECK-SD: // %bb.0: // %entry
1982-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
19831982
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
19841983
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1984+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
19851985
; CHECK-SD-NEXT: and x8, x0, #0x1f
19861986
; CHECK-SD-NEXT: mov x9, sp
19871987
; CHECK-SD-NEXT: ldrb w0, [x9, x8]
@@ -2135,9 +2135,9 @@ entry:
21352135
define i16 @extract_v16i16_c(<16 x i16> %a, i32 %c) {
21362136
; CHECK-SD-LABEL: extract_v16i16_c:
21372137
; CHECK-SD: // %bb.0: // %entry
2138-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
21392138
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
21402139
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
2140+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
21412141
; CHECK-SD-NEXT: and x8, x0, #0xf
21422142
; CHECK-SD-NEXT: mov x9, sp
21432143
; CHECK-SD-NEXT: ldrh w0, [x9, x8, lsl #1]
@@ -2368,9 +2368,9 @@ entry:
23682368
define i32 @extract_v8i32_c(<8 x i32> %a, i32 %c) {
23692369
; CHECK-SD-LABEL: extract_v8i32_c:
23702370
; CHECK-SD: // %bb.0: // %entry
2371-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
23722371
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
23732372
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
2373+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
23742374
; CHECK-SD-NEXT: and x8, x0, #0x7
23752375
; CHECK-SD-NEXT: mov x9, sp
23762376
; CHECK-SD-NEXT: ldr w0, [x9, x8, lsl #2]
@@ -2551,9 +2551,9 @@ entry:
25512551
define i64 @extract_v4i64_c(<4 x i64> %a, i32 %c) {
25522552
; CHECK-SD-LABEL: extract_v4i64_c:
25532553
; CHECK-SD: // %bb.0: // %entry
2554-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
25552554
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
25562555
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
2556+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
25572557
; CHECK-SD-NEXT: and x8, x0, #0x3
25582558
; CHECK-SD-NEXT: mov x9, sp
25592559
; CHECK-SD-NEXT: ldr x0, [x9, x8, lsl #3]

0 commit comments

Comments
 (0)