[PATCH] D157633: [MachineScheduler] Account for lane masks in basic block liveins
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 11 05:26:49 PDT 2023
foad updated this revision to Diff 549349.
foad added a comment.
Simplify
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157633/new/
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,10 @@
// 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 & LI.LaneMask).any()) &&
+ !Uses.contains(Unit))
Uses.insert(PhysRegSUOper(&ExitSU, -1, Unit));
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157633.549349.patch
Type: text/x-patch
Size: 1556 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230811/c06c72bf/attachment.bin>
More information about the llvm-commits
mailing list