[PATCH] D74805: [AMDGPU] Fix assumption about LaneBitmask content
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 18 16:22:39 PST 2020
rampitec created this revision.
rampitec added a reviewer: arsenm.
Herald added subscribers: kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.
Herald added a project: LLVM.
Yet another assumption about an actual LaneBitmask content
is fixed.
https://reviews.llvm.org/D74805
Files:
llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
Index: llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
+++ llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
@@ -103,7 +103,8 @@
LaneBitmask PrevMask,
LaneBitmask NewMask,
const MachineRegisterInfo &MRI) {
- if (NewMask == PrevMask)
+ if (SIRegisterInfo::getNumCoveredRegs(NewMask) ==
+ SIRegisterInfo::getNumCoveredRegs(PrevMask))
return;
int Sign = 1;
@@ -111,21 +112,17 @@
std::swap(NewMask, PrevMask);
Sign = -1;
}
-#ifndef NDEBUG
- const auto MaxMask = MRI.getMaxLaneMaskForVReg(Reg);
-#endif
+
switch (auto Kind = getRegKind(Reg, MRI)) {
case SGPR32:
case VGPR32:
case AGPR32:
- assert(PrevMask.none() && NewMask == MaxMask);
Value[Kind] += Sign;
break;
case SGPR_TUPLE:
case VGPR_TUPLE:
case AGPR_TUPLE:
- assert(NewMask < MaxMask || NewMask == MaxMask);
assert(PrevMask < NewMask);
Value[Kind == SGPR_TUPLE ? SGPR32 : Kind == AGPR_TUPLE ? AGPR32 : VGPR32] +=
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74805.245298.patch
Type: text/x-patch
Size: 1127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200219/2bc91e0e/attachment-0001.bin>
More information about the llvm-commits
mailing list