Skip to content
Merged
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
3dc03fb
avoid put implicit_def into bundle that break reg's liveness
Shoreshen Jun 3, 2025
2fcb149
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 4, 2025
80decd5
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 4, 2025
f58ef06
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 5, 2025
09b8fe5
Merge remote-tracking branch 'origin/main' into bundle-break-phyreg-l…
Shoreshen Jun 6, 2025
f3550df
Applying comments from Jayfold and Matthew, using finilizebundle to f…
Shoreshen Jun 6, 2025
915335a
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 9, 2025
c1b220c
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 10, 2025
a002223
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 11, 2025
03e031b
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 12, 2025
f42e25d
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 12, 2025
11659cd
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 12, 2025
77a7133
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 13, 2025
645776b
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 13, 2025
f606540
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 16, 2025
cfa6151
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 16, 2025
b18da74
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 17, 2025
3d8ef74
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 18, 2025
cbbc41e
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 19, 2025
d4db5d5
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 20, 2025
027802b
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 23, 2025
849b834
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 24, 2025
88c1ac8
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 25, 2025
abd5e4b
use regunit, fix matthew's comments
Shoreshen Jun 25, 2025
5f2f332
fix test case with space
Shoreshen Jun 25, 2025
d5d3d62
Merge remote-tracking branch 'origin/main' into bundle-break-phyreg-l…
Shoreshen Jun 25, 2025
1f90eda
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 26, 2025
a651fbf
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 26, 2025
44d8db6
remove subreg, fix tests
Shoreshen Jun 26, 2025
e422935
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 26, 2025
3d81548
fix bundle tests
Shoreshen Jun 26, 2025
5d5bb3a
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 27, 2025
fa9c8fe
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jun 30, 2025
48c869d
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 1, 2025
047ef09
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 2, 2025
9f6ea59
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 4, 2025
d90bc62
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 7, 2025
810092f
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 8, 2025
4e8b5c4
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 8, 2025
daffa51
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 9, 2025
b36f3fc
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 10, 2025
51b0d71
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 11, 2025
2e72677
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 14, 2025
49f6ee5
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 15, 2025
5403864
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 16, 2025
eac10fb
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 17, 2025
3c3b15d
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 18, 2025
fc87143
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 21, 2025
09c4b66
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 22, 2025
d75fa3d
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 23, 2025
114ce02
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 23, 2025
cf3344e
fix failing case
Shoreshen Jul 24, 2025
1026e5e
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 24, 2025
8706753
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 25, 2025
e59fe4e
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 28, 2025
23f8c29
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 29, 2025
db3dbfc
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 30, 2025
fb35271
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 30, 2025
957b617
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 31, 2025
500e352
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Jul 31, 2025
39115f1
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Aug 4, 2025
6326f19
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Aug 5, 2025
939051b
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Aug 6, 2025
0e4e1b8
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Aug 6, 2025
63e957e
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Aug 6, 2025
b54bb86
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Aug 7, 2025
002ecc5
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Aug 8, 2025
a9b4c4e
fix failing test
Shoreshen Aug 8, 2025
4ba4334
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Aug 11, 2025
7abccdd
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Aug 12, 2025
6eadc58
fix comments
Shoreshen Aug 12, 2025
eee8139
Update llvm/lib/CodeGen/MachineInstrBundle.cpp
Shoreshen Aug 12, 2025
58ebd67
fix comments
Shoreshen Aug 12, 2025
c0febed
Merge branch 'main' into bundle-break-phyreg-liveness
Shoreshen Aug 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions llvm/lib/CodeGen/MachineInstrBundle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI,
return DebugLoc();
}

static bool containReg(SmallSetVector<Register, 32> LocalDefsV,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static bool containReg(SmallSetVector<Register, 32> LocalDefsV,
static bool containsReg(SmallSetVector<Register, 32> LocalDefsV,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document that LocalDefsV is for virtual registers, and LocalDefsP for physregs

BitVector LocalDefsP, Register Reg,
const TargetRegisterInfo *TRI) {
if (Reg.isPhysical()) {
for (MCRegUnit Unit : TRI->regunits(Reg.asMCReg()))
if (!LocalDefsP[Unit])
return false;

Comment on lines +104 to +107
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (MCRegUnit Unit : TRI->regunits(Reg.asMCReg()))
if (!LocalDefsP[Unit])
return false;
for (MCRegUnit Unit : TRI->regunits(Reg.asMCReg())) {
if (!LocalDefsP[Unit])
return false;
}

return true;
}
return LocalDefsV.contains(Reg);
}

/// finalizeBundle - Finalize a machine instruction bundle which includes
/// a sequence of instructions starting from FirstMI to LastMI (exclusive).
/// This routine adds a BUNDLE instruction to represent the bundle, it adds
Expand All @@ -115,6 +128,7 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB,
Bundle.prepend(MIB);

SmallSetVector<Register, 32> LocalDefs;
BitVector LocalDefsP(TRI->getNumRegUnits());
SmallSet<Register, 8> DeadDefSet;
SmallSet<Register, 16> KilledDefSet;
SmallSetVector<Register, 8> ExternUses;
Expand All @@ -130,7 +144,7 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB,
if (!Reg)
continue;

if (LocalDefs.contains(Reg)) {
if (containReg(LocalDefs, LocalDefsP, Reg, TRI)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (containReg(LocalDefs, LocalDefsP, Reg, TRI)) {
if (containsReg(LocalDefs, LocalDefsP, Reg, TRI)) {

MO.setIsInternalRead();
if (MO.isKill()) {
// Internal def is now killed.
Expand Down Expand Up @@ -165,8 +179,10 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB,
}
}

if (!MO.isDead() && Reg.isPhysical())
LocalDefs.insert_range(TRI->subregs(Reg));
if (!MO.isDead() && Reg.isPhysical()) {
for (MCRegUnit Unit : TRI->regunits(Reg.asMCReg()))
LocalDefsP.set(Unit);
}
}

// Set FrameSetup/FrameDestroy for the bundle. If any of the instructions
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/AArch64/blr-bti-preserves-operands.mir
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# The arguments to the call must become implicit arguments, because the branch
# only expects to get 1 explicit operand which is the branch target.

# CHECK: BUNDLE implicit-def $lr, implicit-def $w30, implicit-def $w30_hi, implicit-def $sp, implicit-def $wsp, implicit-def $wsp_hi, implicit $sp, implicit $x0, implicit $w1 {
# CHECK: BUNDLE implicit-def $lr, implicit-def $sp, implicit $sp, implicit $x0, implicit $w1 {
# CHECK: BL @_setjmp, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $w1, implicit-def dead $lr, implicit $sp, implicit-def $sp
# CHECK: HINT 36
# CHECK: }
Expand Down
14 changes: 7 additions & 7 deletions llvm/test/CodeGen/AArch64/expand-blr-rvmarker-pseudo.mir
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# CHECK: bb.0:
# CHECK-NEXT: liveins:
# CHECK-NEXT: {{ $}}
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $w30, implicit-def $w30_hi, implicit-def $sp, implicit-def $wsp, implicit-def $wsp_hi, implicit-def dead $x0, implicit-def $fp, implicit-def $w29, implicit-def $w29_hi, implicit $x0, implicit $sp, implicit $xzr, implicit $fp {
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $sp, implicit-def dead $x0, implicit-def $fp, implicit $x0, implicit $sp, implicit $xzr, implicit $fp {
# CHECK-NEXT: BLR $x0, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
# CHECK-NEXT: ORRXrs $xzr, $fp, 0
# CHECK-NEXT: BL @attachedcall, implicit-def $lr, implicit internal $sp
Expand All @@ -66,7 +66,7 @@ body: |
# CHECK: bb.0:
# CHECK-NEXT: liveins:
# CHECK-NEXT: {{ $}}
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $w30, implicit-def $w30_hi, implicit-def $sp, implicit-def $wsp, implicit-def $wsp_hi, implicit-def dead $x0, implicit-def $fp, implicit-def $w29, implicit-def $w29_hi, implicit $sp, implicit $x0, implicit $xzr, implicit $fp {
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $sp, implicit-def dead $x0, implicit-def $fp, implicit $sp, implicit $x0, implicit $xzr, implicit $fp {
# CHECK-NEXT: BL @foo, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
# CHECK-NEXT: $fp = ORRXrs $xzr, $fp, 0
# CHECK-NEXT: BL @attachedcall, implicit-def $lr, implicit internal $sp
Expand All @@ -86,7 +86,7 @@ body: |
# CHECK: bb.0:
# CHECK-NEXT: liveins:
# CHECK-NEXT: {{ $}}
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $w30, implicit-def $w30_hi, implicit-def $sp, implicit-def $wsp, implicit-def $wsp_hi, implicit-def $x0, implicit-def $w0, implicit-def $w0_hi, implicit-def $fp, implicit-def $w29, implicit-def $w29_hi, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit $xzr, implicit $fp {
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $sp, implicit-def $x0, implicit-def $fp, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit $xzr, implicit $fp {
# CHECK-NEXT: BL @foo, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $x0
# CHECK-NEXT: $fp = ORRXrs $xzr, $fp, 0
# CHECK-NEXT: BL @attachedcall, implicit-def $lr, implicit internal $sp
Expand All @@ -106,7 +106,7 @@ body: |
# CHECK: bb.0:
# CHECK-NEXT: liveins:
# CHECK-NEXT: {{ $}}
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $w30, implicit-def $w30_hi, implicit-def $sp, implicit-def $wsp, implicit-def $wsp_hi, implicit-def dead $x0, implicit-def $fp, implicit-def $w29, implicit-def $w29_hi, implicit $sp, implicit $w0, implicit $w1, implicit $xzr, implicit $fp {
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $sp, implicit-def dead $x0, implicit-def $fp, implicit $sp, implicit $w0, implicit $w1, implicit $xzr, implicit $fp {
# CHECK-NEXT: BL @foo, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $w0, implicit $w1, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
# CHECK-NEXT: $fp = ORRXrs $xzr, $fp, 0
# CHECK-NEXT: BL @attachedcall, implicit-def $lr, implicit internal $sp
Expand All @@ -127,7 +127,7 @@ body: |
# CHECK: bb.0:
# CHECK-NEXT: liveins:
# CHECK-NEXT: {{ $}}
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $w30, implicit-def $w30_hi, implicit-def $sp, implicit-def $wsp, implicit-def $wsp_hi, implicit-def dead $x0, implicit-def $fp, implicit-def $w29, implicit-def $w29_hi, implicit $x8, implicit $sp, implicit $w0, implicit $w1, implicit $xzr, implicit $fp {
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $sp, implicit-def dead $x0, implicit-def $fp, implicit $x8, implicit $sp, implicit $w0, implicit $w1, implicit $xzr, implicit $fp {
# CHECK-NEXT: BLR $x8, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $w0, implicit $w1, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
# CHECK-NEXT: $fp = ORRXrs $xzr, $fp, 0
# CHECK-NEXT: BL @attachedcall, implicit-def $lr, implicit internal $sp
Expand All @@ -149,7 +149,7 @@ body: |
# CHECK: bb.0:
# CHECK-NEXT: liveins:
# CHECK-NEXT: {{ $}}
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $w30, implicit-def $w30_hi, implicit-def $sp, implicit-def $wsp, implicit-def $wsp_hi, implicit-def dead $x0, implicit-def $fp, implicit-def $w29, implicit-def $w29_hi, implicit $sp, implicit undef $x0, implicit $xzr, implicit $fp {
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $sp, implicit-def dead $x0, implicit-def $fp, implicit $sp, implicit undef $x0, implicit $xzr, implicit $fp {
# CHECK-NEXT: BL @foo, csr_darwin_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit undef $x0, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
# CHECK-NEXT: $fp = ORRXrs $xzr, $fp, 0
# CHECK-NEXT: BL @objc_retainAutoreleasedReturnValue, implicit-def $lr, implicit internal $sp
Expand All @@ -170,7 +170,7 @@ body: |
# CHECK: bb.0:
# CHECK-NEXT: liveins:
# CHECK-NEXT: {{ $}}
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $w30, implicit-def $w30_hi, implicit-def $sp, implicit-def $wsp, implicit-def $wsp_hi, implicit-def dead $x0, implicit $x0, implicit $sp {
# CHECK-NEXT: BUNDLE implicit-def $lr, implicit-def $sp, implicit-def dead $x0, implicit $x0, implicit $sp {
# CHECK-NEXT: BLR $x0, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def dead $x0
# CHECK-NEXT: BL @attachedcall, implicit-def $lr, implicit internal $sp
# CHECK-NEXT: }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ body: |
; CHECK-LABEL: name: bic_i16_zero
; CHECK: liveins: $p0, $z0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: BUNDLE implicit-def $z0, implicit-def $q0, implicit-def $d0, implicit-def $s0, implicit-def $h0, implicit-def $b0, implicit-def $b0_hi, implicit-def $h0_hi, implicit-def $s0_hi, implicit-def $d0_hi, implicit-def $q0_hi, implicit killed $p0, implicit $z0 {
; CHECK-NEXT: BUNDLE implicit-def $z0, implicit killed $p0, implicit $z0 {
; CHECK-NEXT: $z0 = MOVPRFX_ZPzZ_H $p0, $z0
; CHECK-NEXT: $z0 = LSL_ZPmI_H killed renamable $p0, internal $z0, 0
; CHECK-NEXT: $z0 = BIC_ZPmZ_H killed renamable $p0, internal killed $z0, internal killed renamable $z0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ body: |
; CHECK-LABEL: name: fmul_float_zero
; CHECK: liveins: $p0, $z0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: BUNDLE implicit-def $z0, implicit-def $q0, implicit-def $d0, implicit-def $s0, implicit-def $h0, implicit-def $b0, implicit-def $b0_hi, implicit-def $h0_hi, implicit-def $s0_hi, implicit-def $d0_hi, implicit-def $q0_hi, implicit $p0, implicit $z0 {
; CHECK-NEXT: BUNDLE implicit-def $z0, implicit $p0, implicit $z0 {
; CHECK-NEXT: $z0 = MOVPRFX_ZPzZ_S $p0, $z0
; CHECK-NEXT: $z0 = LSL_ZPmI_S renamable $p0, internal $z0, 0
; CHECK-NEXT: $z0 = FMUL_ZPmZ_S renamable $p0, internal killed $z0, internal killed renamable $z0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ body: |
; CHECK-LABEL: name: fsub_s_zero
; CHECK: liveins: $p0, $z0
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: BUNDLE implicit-def $z0, implicit-def $q0, implicit-def $d0, implicit-def $s0, implicit-def $h0, implicit-def $b0, implicit-def $b0_hi, implicit-def $h0_hi, implicit-def $s0_hi, implicit-def $d0_hi, implicit-def $q0_hi, implicit $p0, implicit $z0 {
; CHECK-NEXT: BUNDLE implicit-def $z0, implicit $p0, implicit $z0 {
; CHECK-NEXT: $z0 = MOVPRFX_ZPzZ_S $p0, $z0
; CHECK-NEXT: $z0 = LSL_ZPmI_S renamable $p0, internal $z0, 0
; CHECK-NEXT: $z0 = FSUBR_ZPmZ_S renamable $p0, internal killed $z0, internal killed renamable $z0
Expand Down
36 changes: 36 additions & 0 deletions llvm/test/CodeGen/AMDGPU/bundle-breaks-phy-liveness.mir
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
# RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -run-pass=si-insert-hard-clauses -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN-CLAUSE %s
# RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -run-pass=si-post-ra-bundler -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN-BUNDLE %s

---
name: clause_implicit_def
tracksRegLiveness: true
body: |
bb.0:
liveins: $vgpr0, $sgpr32

; GCN-CLAUSE-LABEL: name: clause_implicit_def
; GCN-CLAUSE: liveins: $vgpr0, $sgpr32
; GCN-CLAUSE-NEXT: {{ $}}
; GCN-CLAUSE-NEXT: BUNDLE implicit-def $vgpr2, implicit-def $vgpr3, implicit $vgpr0, implicit $sgpr32, implicit $exec, implicit $flat_scr {
; GCN-CLAUSE-NEXT: S_CLAUSE 1
; GCN-CLAUSE-NEXT: SCRATCH_STORE_DWORD_SADDR $vgpr0, $sgpr32, 8, 0, implicit $exec, implicit $flat_scr
; GCN-CLAUSE-NEXT: $vgpr2 = IMPLICIT_DEF
; GCN-CLAUSE-NEXT: $vgpr3 = IMPLICIT_DEF
; GCN-CLAUSE-NEXT: SCRATCH_STORE_DWORDX2_SADDR internal $vgpr2_vgpr3, $sgpr32, 16, 0, implicit $exec, implicit $flat_scr
; GCN-CLAUSE-NEXT: }
;
; GCN-BUNDLE-LABEL: name: clause_implicit_def
; GCN-BUNDLE: liveins: $vgpr0, $sgpr32
; GCN-BUNDLE-NEXT: {{ $}}
; GCN-BUNDLE-NEXT: BUNDLE implicit-def $vgpr2, implicit-def $vgpr3, implicit $vgpr0, implicit $sgpr32, implicit $exec, implicit $flat_scr {
; GCN-BUNDLE-NEXT: SCRATCH_STORE_DWORD_SADDR $vgpr0, $sgpr32, 8, 0, implicit $exec, implicit $flat_scr
; GCN-BUNDLE-NEXT: $vgpr2 = IMPLICIT_DEF
; GCN-BUNDLE-NEXT: $vgpr3 = IMPLICIT_DEF
; GCN-BUNDLE-NEXT: SCRATCH_STORE_DWORDX2_SADDR internal $vgpr2_vgpr3, $sgpr32, 16, 0, implicit $exec, implicit $flat_scr
; GCN-BUNDLE-NEXT: }
SCRATCH_STORE_DWORD_SADDR $vgpr0, $sgpr32, 8, 0, implicit $exec, implicit $flat_scr
$vgpr2 = IMPLICIT_DEF
$vgpr3 = IMPLICIT_DEF
SCRATCH_STORE_DWORDX2_SADDR $vgpr2_vgpr3, $sgpr32, 16, 0, implicit $exec, implicit $flat_scr
...
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/AMDGPU/finalizebundle.mir
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body: |
; CHECK-LABEL: name: test_overlap
; CHECK: liveins: $vgpr0_vgpr1
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: BUNDLE implicit-def $vgpr2_vgpr3, implicit-def $vgpr2, implicit-def $vgpr2_lo16, implicit-def $vgpr2_hi16, implicit-def $vgpr3, implicit-def $vgpr3_lo16, implicit-def $vgpr3_hi16, implicit-def $vgpr3_vgpr4, implicit-def $vgpr4, implicit-def $vgpr4_lo16, implicit-def $vgpr4_hi16, implicit $vgpr0_vgpr1, implicit $exec, implicit $vgpr1_vgpr2 {
; CHECK-NEXT: BUNDLE implicit-def $vgpr2_vgpr3, implicit-def $vgpr3_vgpr4, implicit $vgpr0_vgpr1, implicit $exec, implicit $vgpr1_vgpr2 {
; CHECK-NEXT: $vgpr2_vgpr3 = V_LSHLREV_B64_pseudo_e32 1, $vgpr0_vgpr1, implicit $exec
; CHECK-NEXT: $vgpr3_vgpr4 = V_LSHLREV_B64_pseudo_e32 1, $vgpr1_vgpr2, implicit $exec
; CHECK-NEXT: }
Expand Down
Loading
Loading