Skip to content

Commit 011b541

Browse files
[AArch64] Prevent the AArch64LoadStoreOptimizer from reordering CFI instructions
When AArch64LoadStoreOptimizer pass merges an SP update with a load/store instruction 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 84ef8f8 commit 011b541

File tree

7 files changed

+142
-67
lines changed

7 files changed

+142
-67
lines changed

llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp

Lines changed: 79 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -176,18 +176,23 @@ struct AArch64LoadStoreOpt : public MachineFunctionPass {
176176
// Scan the instruction list to find a base register update that can
177177
// be combined with the current instruction (a load or store) using
178178
// pre or post indexed addressing with writeback. Scan backwards.
179+
// `MergeEither` is set to true if the combined instruction may be placed
180+
// either at the location of the load/store instruction or at the location of
181+
// the update intruction.
179182
MachineBasicBlock::iterator
180-
findMatchingUpdateInsnBackward(MachineBasicBlock::iterator I, unsigned Limit);
183+
findMatchingUpdateInsnBackward(MachineBasicBlock::iterator I, unsigned Limit,
184+
bool &MergeEither);
181185

182186
// Find an instruction that updates the base register of the ld/st
183187
// instruction.
184188
bool isMatchingUpdateInsn(MachineInstr &MemMI, MachineInstr &MI,
185189
unsigned BaseReg, int Offset);
186190

187191
// Merge a pre- or post-index base register update into a ld/st instruction.
188-
MachineBasicBlock::iterator
192+
std::optional<MachineBasicBlock::iterator>
189193
mergeUpdateInsn(MachineBasicBlock::iterator I,
190-
MachineBasicBlock::iterator Update, bool IsPreIdx);
194+
MachineBasicBlock::iterator Update, bool IsForward,
195+
bool IsPreIdx, bool MergeEither);
191196

192197
// Find and merge zero store instructions.
193198
bool tryToMergeZeroStInst(MachineBasicBlock::iterator &MBBI);
@@ -1971,20 +1976,37 @@ maybeMoveCFI(MachineInstr &MI, MachineBasicBlock::iterator MaybeCFI) {
19711976
}
19721977
}
19731978

1974-
MachineBasicBlock::iterator
1975-
AArch64LoadStoreOpt::mergeUpdateInsn(MachineBasicBlock::iterator I,
1976-
MachineBasicBlock::iterator Update,
1977-
bool IsPreIdx) {
1979+
std::optional<MachineBasicBlock::iterator> AArch64LoadStoreOpt::mergeUpdateInsn(
1980+
MachineBasicBlock::iterator I, MachineBasicBlock::iterator Update,
1981+
bool IsForward, bool IsPreIdx, bool MergeEither) {
19781982
assert((Update->getOpcode() == AArch64::ADDXri ||
19791983
Update->getOpcode() == AArch64::SUBXri) &&
19801984
"Unexpected base register update instruction to merge!");
19811985
MachineBasicBlock::iterator E = I->getParent()->end();
19821986
MachineBasicBlock::iterator NextI = next_nodbg(I, E);
19831987

1984-
// If updating the SP and the following instruction is CFA offset related CFI
1985-
// instruction move it after the merged instruction.
1986-
MachineBasicBlock::iterator CFI =
1987-
IsPreIdx ? maybeMoveCFI(*Update, next_nodbg(Update, E)) : E;
1988+
// If updating the SP and the following instruction is CFA offset related CFI,
1989+
// make sure the CFI follows the SP update either by merging at the location
1990+
// of the update or by moving the CFI after the merged instruction. If unable
1991+
// to do so, bail.
1992+
MachineBasicBlock::iterator InsertPt = I;
1993+
if (IsForward) {
1994+
assert(IsPreIdx);
1995+
if (auto CFI = maybeMoveCFI(*Update, next_nodbg(Update, E)); CFI != E) {
1996+
if (MergeEither) {
1997+
InsertPt = Update;
1998+
} else {
1999+
// Take care not to reorder CFIs.
2000+
if (std::any_of(std::next(CFI), I, [](const auto &Insn) {
2001+
return Insn.getOpcode() == TargetOpcode::CFI_INSTRUCTION;
2002+
}))
2003+
return std::nullopt;
2004+
2005+
MachineBasicBlock *MBB = InsertPt->getParent();
2006+
MBB->splice(std::next(InsertPt), MBB, CFI);
2007+
}
2008+
}
2009+
}
19882010

19892011
// Return the instruction following the merged instruction, which is
19902012
// the instruction following our unmerged load. Unless that's the add/sub
@@ -2005,7 +2027,8 @@ AArch64LoadStoreOpt::mergeUpdateInsn(MachineBasicBlock::iterator I,
20052027
getPrePostIndexedMemOpInfo(*I, Scale, MinOffset, MaxOffset);
20062028
if (!AArch64InstrInfo::isPairedLdSt(*I)) {
20072029
// Non-paired instruction.
2008-
MIB = BuildMI(*I->getParent(), I, I->getDebugLoc(), TII->get(NewOpc))
2030+
MIB = BuildMI(*InsertPt->getParent(), InsertPt, InsertPt->getDebugLoc(),
2031+
TII->get(NewOpc))
20092032
.add(Update->getOperand(0))
20102033
.add(getLdStRegOp(*I))
20112034
.add(AArch64InstrInfo::getLdStBaseOp(*I))
@@ -2014,7 +2037,8 @@ AArch64LoadStoreOpt::mergeUpdateInsn(MachineBasicBlock::iterator I,
20142037
.setMIFlags(I->mergeFlagsWith(*Update));
20152038
} else {
20162039
// Paired instruction.
2017-
MIB = BuildMI(*I->getParent(), I, I->getDebugLoc(), TII->get(NewOpc))
2040+
MIB = BuildMI(*InsertPt->getParent(), InsertPt, InsertPt->getDebugLoc(),
2041+
TII->get(NewOpc))
20182042
.add(Update->getOperand(0))
20192043
.add(getLdStRegOp(*I, 0))
20202044
.add(getLdStRegOp(*I, 1))
@@ -2023,10 +2047,6 @@ AArch64LoadStoreOpt::mergeUpdateInsn(MachineBasicBlock::iterator I,
20232047
.setMemRefs(I->memoperands())
20242048
.setMIFlags(I->mergeFlagsWith(*Update));
20252049
}
2026-
if (CFI != E) {
2027-
MachineBasicBlock *MBB = I->getParent();
2028-
MBB->splice(std::next(MIB.getInstr()->getIterator()), MBB, CFI);
2029-
}
20302050

20312051
if (IsPreIdx) {
20322052
++NumPreFolded;
@@ -2174,7 +2194,7 @@ MachineBasicBlock::iterator AArch64LoadStoreOpt::findMatchingUpdateInsnForward(
21742194
}
21752195

21762196
MachineBasicBlock::iterator AArch64LoadStoreOpt::findMatchingUpdateInsnBackward(
2177-
MachineBasicBlock::iterator I, unsigned Limit) {
2197+
MachineBasicBlock::iterator I, unsigned Limit, bool &MergeEither) {
21782198
MachineBasicBlock::iterator B = I->getParent()->begin();
21792199
MachineBasicBlock::iterator E = I->getParent()->end();
21802200
MachineInstr &MemMI = *I;
@@ -2184,19 +2204,21 @@ MachineBasicBlock::iterator AArch64LoadStoreOpt::findMatchingUpdateInsnBackward(
21842204
Register BaseReg = AArch64InstrInfo::getLdStBaseOp(MemMI).getReg();
21852205
int Offset = AArch64InstrInfo::getLdStOffsetOp(MemMI).getImm();
21862206

2207+
bool IsPairedInsn = AArch64InstrInfo::isPairedLdSt(MemMI);
2208+
Register DestReg[] = {getLdStRegOp(MemMI, 0).getReg(),
2209+
IsPairedInsn ? getLdStRegOp(MemMI, 1).getReg()
2210+
: AArch64::NoRegister};
2211+
21872212
// If the load/store is the first instruction in the block, there's obviously
21882213
// not any matching update. Ditto if the memory offset isn't zero.
21892214
if (MBBI == B || Offset != 0)
21902215
return E;
21912216
// If the base register overlaps a destination register, we can't
21922217
// merge the update.
21932218
if (!isTagStore(MemMI)) {
2194-
bool IsPairedInsn = AArch64InstrInfo::isPairedLdSt(MemMI);
2195-
for (unsigned i = 0, e = IsPairedInsn ? 2 : 1; i != e; ++i) {
2196-
Register DestReg = getLdStRegOp(MemMI, i).getReg();
2197-
if (DestReg == BaseReg || TRI->isSubRegister(BaseReg, DestReg))
2219+
for (unsigned i = 0, e = IsPairedInsn ? 2 : 1; i != e; ++i)
2220+
if (DestReg[i] == BaseReg || TRI->isSubRegister(BaseReg, DestReg[i]))
21982221
return E;
2199-
}
22002222
}
22012223

22022224
const bool BaseRegSP = BaseReg == AArch64::SP;
@@ -2217,6 +2239,7 @@ MachineBasicBlock::iterator AArch64LoadStoreOpt::findMatchingUpdateInsnBackward(
22172239
UsedRegUnits.clear();
22182240
unsigned Count = 0;
22192241
bool MemAcessBeforeSPPreInc = false;
2242+
MergeEither = true;
22202243
do {
22212244
MBBI = prev_nodbg(MBBI, B);
22222245
MachineInstr &MI = *MBBI;
@@ -2243,6 +2266,20 @@ MachineBasicBlock::iterator AArch64LoadStoreOpt::findMatchingUpdateInsnBackward(
22432266
if (!ModifiedRegUnits.available(BaseReg) ||
22442267
!UsedRegUnits.available(BaseReg))
22452268
return E;
2269+
2270+
// If we have a destination register (i.e. a load instruction) and a
2271+
// destination register is used or modified, then we can only merge forward,
2272+
// i.e. the combined instruction is put in the place of the memory
2273+
// instruction. Same applies if we see a memory access or side effects.
2274+
if (MI.mayLoadOrStore() || MI.hasUnmodeledSideEffects() ||
2275+
(DestReg[0] != AArch64::NoRegister &&
2276+
!(ModifiedRegUnits.available(DestReg[0]) &&
2277+
UsedRegUnits.available(DestReg[0]))) ||
2278+
(DestReg[1] != AArch64::NoRegister &&
2279+
!(ModifiedRegUnits.available(DestReg[1]) &&
2280+
UsedRegUnits.available(DestReg[1]))))
2281+
MergeEither = false;
2282+
22462283
// Keep track if we have a memory access before an SP pre-increment, in this
22472284
// case we need to validate later that the update amount respects the red
22482285
// zone.
@@ -2399,8 +2436,12 @@ bool AArch64LoadStoreOpt::tryToMergeLdStUpdate
23992436
Update = findMatchingUpdateInsnForward(MBBI, 0, UpdateLimit);
24002437
if (Update != E) {
24012438
// Merge the update into the ld/st.
2402-
MBBI = mergeUpdateInsn(MBBI, Update, /*IsPreIdx=*/false);
2403-
return true;
2439+
if (auto NextI = mergeUpdateInsn(MBBI, Update, /*IsForward=*/false,
2440+
/*IsPreIdx=*/false,
2441+
/*MergeEither=*/false)) {
2442+
MBBI = *NextI;
2443+
return true;
2444+
}
24042445
}
24052446

24062447
// Don't know how to handle unscaled pre/post-index versions below, so bail.
@@ -2412,11 +2453,15 @@ bool AArch64LoadStoreOpt::tryToMergeLdStUpdate
24122453
// ldr x1, [x0]
24132454
// merged into:
24142455
// ldr x1, [x0, #8]!
2415-
Update = findMatchingUpdateInsnBackward(MBBI, UpdateLimit);
2456+
bool MergeEither;
2457+
Update = findMatchingUpdateInsnBackward(MBBI, UpdateLimit, MergeEither);
24162458
if (Update != E) {
24172459
// Merge the update into the ld/st.
2418-
MBBI = mergeUpdateInsn(MBBI, Update, /*IsPreIdx=*/true);
2419-
return true;
2460+
if (auto NextI = mergeUpdateInsn(MBBI, Update, /*IsForward=*/true,
2461+
/*IsPreIdx=*/true, MergeEither)) {
2462+
MBBI = *NextI;
2463+
return true;
2464+
}
24202465
}
24212466

24222467
// The immediate in the load/store is scaled by the size of the memory
@@ -2433,8 +2478,12 @@ bool AArch64LoadStoreOpt::tryToMergeLdStUpdate
24332478
Update = findMatchingUpdateInsnForward(MBBI, UnscaledOffset, UpdateLimit);
24342479
if (Update != E) {
24352480
// Merge the update into the ld/st.
2436-
MBBI = mergeUpdateInsn(MBBI, Update, /*IsPreIdx=*/true);
2437-
return true;
2481+
if (auto NextI = mergeUpdateInsn(MBBI, Update, /*IsForward=*/false,
2482+
/*IsPreIdx=*/true,
2483+
/*MergeEither=*/false)) {
2484+
MBBI = *NextI;
2485+
return true;
2486+
}
24382487
}
24392488

24402489
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]
@@ -396,9 +396,9 @@ entry:
396396
define <8 x float> @insert_v8f32_c(<8 x float> %a, float %b, i32 %c) {
397397
; CHECK-SD-LABEL: insert_v8f32_c:
398398
; CHECK-SD: // %bb.0: // %entry
399-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
400399
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
401400
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
401+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
402402
; CHECK-SD-NEXT: and x8, x0, #0x7
403403
; CHECK-SD-NEXT: mov x9, sp
404404
; CHECK-SD-NEXT: str s2, [x9, x8, lsl #2]
@@ -561,9 +561,9 @@ entry:
561561
define <16 x half> @insert_v16f16_c(<16 x half> %a, half %b, i32 %c) {
562562
; CHECK-SD-LABEL: insert_v16f16_c:
563563
; CHECK-SD: // %bb.0: // %entry
564-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
565564
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
566565
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
566+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
567567
; CHECK-SD-NEXT: and x8, x0, #0xf
568568
; CHECK-SD-NEXT: mov x9, sp
569569
; CHECK-SD-NEXT: str h2, [x9, x8, lsl #1]
@@ -724,9 +724,9 @@ entry:
724724
define <32 x i8> @insert_v32i8_c(<32 x i8> %a, i8 %b, i32 %c) {
725725
; CHECK-SD-LABEL: insert_v32i8_c:
726726
; CHECK-SD: // %bb.0: // %entry
727-
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
728727
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
729728
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
729+
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
730730
; CHECK-SD-NEXT: and x8, x1, #0x1f
731731
; CHECK-SD-NEXT: mov x9, sp
732732
; CHECK-SD-NEXT: strb w0, [x9, x8]
@@ -885,9 +885,9 @@ entry:
885885
define <16 x i16> @insert_v16i16_c(<16 x i16> %a, i16 %b, i32 %c) {
886886
; CHECK-SD-LABEL: insert_v16i16_c:
887887
; CHECK-SD: // %bb.0: // %entry
888-
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
889888
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
890889
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
890+
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
891891
; CHECK-SD-NEXT: and x8, x1, #0xf
892892
; CHECK-SD-NEXT: mov x9, sp
893893
; CHECK-SD-NEXT: strh w0, [x9, x8, lsl #1]
@@ -1114,9 +1114,9 @@ entry:
11141114
define <8 x i32> @insert_v8i32_c(<8 x i32> %a, i32 %b, i32 %c) {
11151115
; CHECK-SD-LABEL: insert_v8i32_c:
11161116
; CHECK-SD: // %bb.0: // %entry
1117-
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
11181117
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
11191118
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1119+
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
11201120
; CHECK-SD-NEXT: and x8, x1, #0x7
11211121
; CHECK-SD-NEXT: mov x9, sp
11221122
; CHECK-SD-NEXT: str w0, [x9, x8, lsl #2]
@@ -1299,9 +1299,9 @@ entry:
12991299
define <4 x i64> @insert_v4i64_c(<4 x i64> %a, i64 %b, i32 %c) {
13001300
; CHECK-SD-LABEL: insert_v4i64_c:
13011301
; CHECK-SD: // %bb.0: // %entry
1302-
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
13031302
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
13041303
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1304+
; CHECK-SD-NEXT: // kill: def $w1 killed $w1 def $x1
13051305
; CHECK-SD-NEXT: and x8, x1, #0x3
13061306
; CHECK-SD-NEXT: mov x9, sp
13071307
; CHECK-SD-NEXT: str x0, [x9, x8, lsl #3]
@@ -1465,9 +1465,9 @@ entry:
14651465
define double @extract_v4f64_c(<4 x double> %a, i32 %c) {
14661466
; CHECK-SD-LABEL: extract_v4f64_c:
14671467
; CHECK-SD: // %bb.0: // %entry
1468-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
14691468
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
14701469
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1470+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
14711471
; CHECK-SD-NEXT: and x8, x0, #0x3
14721472
; CHECK-SD-NEXT: mov x9, sp
14731473
; CHECK-SD-NEXT: ldr d0, [x9, x8, lsl #3]
@@ -1673,9 +1673,9 @@ entry:
16731673
define float @extract_v8f32_c(<8 x float> %a, i32 %c) {
16741674
; CHECK-SD-LABEL: extract_v8f32_c:
16751675
; CHECK-SD: // %bb.0: // %entry
1676-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
16771676
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
16781677
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1678+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
16791679
; CHECK-SD-NEXT: and x8, x0, #0x7
16801680
; CHECK-SD-NEXT: mov x9, sp
16811681
; CHECK-SD-NEXT: ldr s0, [x9, x8, lsl #2]
@@ -1832,9 +1832,9 @@ entry:
18321832
define half @extract_v16f16_c(<16 x half> %a, i32 %c) {
18331833
; CHECK-SD-LABEL: extract_v16f16_c:
18341834
; CHECK-SD: // %bb.0: // %entry
1835-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
18361835
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
18371836
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1837+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
18381838
; CHECK-SD-NEXT: and x8, x0, #0xf
18391839
; CHECK-SD-NEXT: mov x9, sp
18401840
; CHECK-SD-NEXT: ldr h0, [x9, x8, lsl #1]
@@ -1990,9 +1990,9 @@ entry:
19901990
define i8 @extract_v32i8_c(<32 x i8> %a, i32 %c) {
19911991
; CHECK-SD-LABEL: extract_v32i8_c:
19921992
; CHECK-SD: // %bb.0: // %entry
1993-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
19941993
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
19951994
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
1995+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
19961996
; CHECK-SD-NEXT: and x8, x0, #0x1f
19971997
; CHECK-SD-NEXT: mov x9, sp
19981998
; CHECK-SD-NEXT: ldrb w0, [x9, x8]
@@ -2146,9 +2146,9 @@ entry:
21462146
define i16 @extract_v16i16_c(<16 x i16> %a, i32 %c) {
21472147
; CHECK-SD-LABEL: extract_v16i16_c:
21482148
; CHECK-SD: // %bb.0: // %entry
2149-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
21502149
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
21512150
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
2151+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
21522152
; CHECK-SD-NEXT: and x8, x0, #0xf
21532153
; CHECK-SD-NEXT: mov x9, sp
21542154
; CHECK-SD-NEXT: ldrh w0, [x9, x8, lsl #1]
@@ -2379,9 +2379,9 @@ entry:
23792379
define i32 @extract_v8i32_c(<8 x i32> %a, i32 %c) {
23802380
; CHECK-SD-LABEL: extract_v8i32_c:
23812381
; CHECK-SD: // %bb.0: // %entry
2382-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
23832382
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
23842383
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
2384+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
23852385
; CHECK-SD-NEXT: and x8, x0, #0x7
23862386
; CHECK-SD-NEXT: mov x9, sp
23872387
; CHECK-SD-NEXT: ldr w0, [x9, x8, lsl #2]
@@ -2562,9 +2562,9 @@ entry:
25622562
define i64 @extract_v4i64_c(<4 x i64> %a, i32 %c) {
25632563
; CHECK-SD-LABEL: extract_v4i64_c:
25642564
; CHECK-SD: // %bb.0: // %entry
2565-
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
25662565
; CHECK-SD-NEXT: stp q0, q1, [sp, #-32]!
25672566
; CHECK-SD-NEXT: .cfi_def_cfa_offset 32
2567+
; CHECK-SD-NEXT: // kill: def $w0 killed $w0 def $x0
25682568
; CHECK-SD-NEXT: and x8, x0, #0x3
25692569
; CHECK-SD-NEXT: mov x9, sp
25702570
; CHECK-SD-NEXT: ldr x0, [x9, x8, lsl #3]

0 commit comments

Comments
 (0)