[PATCH] D157633: [MachineScheduler] Account for lane masks in basic block liveins
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 10 09:24:52 PDT 2023
foad created this revision.
foad added reviewers: AMDGPU, qcolombet, kparzysz.
Herald added subscribers: StephenFan, kerbowa, hiraditya, jvesely, MatzeB.
Herald added a project: All.
foad requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D157633
Files:
llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
llvm/test/CodeGen/AMDGPU/loop-live-out-copy-undef-subrange.ll
Index: llvm/test/CodeGen/AMDGPU/loop-live-out-copy-undef-subrange.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/loop-live-out-copy-undef-subrange.ll
+++ llvm/test/CodeGen/AMDGPU/loop-live-out-copy-undef-subrange.ll
@@ -10,9 +10,9 @@
; CHECK: ; %bb.0: ; %bb
; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; CHECK-NEXT: v_add_f32_e32 v3, v2, v2
-; CHECK-NEXT: v_add_f32_e32 v0, v0, v0
; CHECK-NEXT: s_mov_b64 s[4:5], 0
; CHECK-NEXT: ; kill: killed $vgpr1
+; CHECK-NEXT: v_add_f32_e32 v0, v0, v0
; CHECK-NEXT: .LBB0_1: ; %bb1
; CHECK-NEXT: ; =>This Inner Loop Header: Depth=1
; CHECK-NEXT: v_cmp_neq_f32_e32 vcc, 0, v2
Index: llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
===================================================================
--- llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -223,9 +223,11 @@
// uses all the registers that are livein to the successor blocks.
for (const MachineBasicBlock *Succ : BB->successors()) {
for (const auto &LI : Succ->liveins()) {
- // TODO: Use LI.LaneMask to refine this.
- for (MCRegUnit Unit : TRI->regunits(LI.PhysReg)) {
- if (!Uses.contains(Unit))
+ for (MCRegUnitMaskIterator U(LI.PhysReg, TRI); U.isValid(); ++U) {
+ auto [Unit, Mask] = *U;
+ if (Mask.none())
+ Mask = LaneBitmask::getAll();
+ if ((Mask & LI.LaneMask).any() && !Uses.contains(Unit))
Uses.insert(PhysRegSUOper(&ExitSU, -1, Unit));
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157633.549078.patch
Type: text/x-patch
Size: 1595 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230810/f149a02a/attachment.bin>
More information about the llvm-commits
mailing list