Skip to content

Commit 1bddd1a

Browse files
Dimus77sys_zuul
authored andcommitted
Changes in code.
Change-Id: I997556c6f8f5fb1efbe903d419fdc4af68688f83
1 parent 04c2960 commit 1bddd1a

13 files changed

+40
-838
lines changed

visa/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ set(GenX_Common_Sources_External
188188
SpillCleanup.cpp
189189
Rematerialization.cpp
190190
RPE.cpp
191-
VarSplit.cpp
192191
${LocalScheduler_SOURCES}
193192
)
194193

@@ -265,7 +264,6 @@ set(GenX_Common_Headers
265264
Metadata.h
266265
RPE.h
267266
include/gtpin_IGC_interface.h
268-
VarSplit.h
269267
${LocalScheduler_HEADERS}
270268
)
271269
set(GenX_CISA_dis_Common_Headers

visa/Gen4_IR.hpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ class G4_INST
700700
G4_SpillIntrinsic* asSpillIntrinsic() const;
701701
bool isFillIntrinsic() const;
702702
G4_FillIntrinsic* asFillIntrinsic() const;
703-
bool isSplitIntrinsic() const;
704703
bool isLifeTimeEnd() const { return op == G4_pseudo_lifetime_end; }
705704
bool isMov() const { return G4_Inst_Table[op].instType == InstTypeMov; }
706705
bool isLogic() const { return G4_Inst_Table[op].instType == InstTypeLogic; }
@@ -1432,7 +1431,6 @@ enum class Intrinsic
14321431
PseudoKill,
14331432
Spill,
14341433
Fill,
1435-
Split,
14361434
NumIntrinsics
14371435
};
14381436

@@ -1470,8 +1468,7 @@ static const IntrinsicInfo G4_Intrinsics[(int)Intrinsic::NumIntrinsics] =
14701468
{Intrinsic::MemFence, "mem_fence", 0, 0, Phase::BinaryEncoding, { 0, 0, 0, false, false } },
14711469
{Intrinsic::PseudoKill, "pseudo_kill", 1, 1, Phase::RA, { 0, 0, 0, false, false} },
14721470
{Intrinsic::Spill, "spill", 1, 2, Phase::RA, { 0, 0, 0, false, false } },
1473-
{Intrinsic::Fill, "fill", 1, 1, Phase::RA, { 0, 0, 0, false, false } },
1474-
{Intrinsic::Split, "split", 1, 1, Phase::RA, { 0, 0, 0, false, false } },
1471+
{Intrinsic::Fill, "fill", 1, 1, Phase::RA, { 0, 0, 0, false, false } }
14751472
};
14761473

14771474
namespace vISA
@@ -3823,11 +3820,6 @@ inline G4_FillIntrinsic* G4_INST::asFillIntrinsic() const
38233820
return const_cast<G4_FillIntrinsic*>(reinterpret_cast<const G4_FillIntrinsic*>(this));
38243821
}
38253822

3826-
inline bool G4_INST::isSplitIntrinsic() const
3827-
{
3828-
return isIntrinsic() && asIntrinsicInst()->getIntrinsicId() == Intrinsic::Split;
3829-
}
3830-
38313823
inline const char* G4_INST::getLabelStr() const
38323824
{
38333825
MUST_BE_TRUE(srcs[0] != NULL && srcs[0]->isLabel(), ERROR_UNKNOWN);

visa/GraphColor.cpp

Lines changed: 8 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -5544,42 +5544,17 @@ bool GraphColor::assignColors(ColorHeuristic colorHeuristicGRF, bool doBankConfl
55445544
doBankConflict, availableGregs, availableSubRegs, availableAddrs, availableFlags, weakEdgeUsage);
55455545
bool noIndirForceSpills = builder.getOption(vISA_NoIndirectForceSpills);
55465546

5547-
auto& varSplitPass = *gra.getVarSplitPass();
5548-
5549-
auto assignColor = [&](LiveRange* lr)
5547+
// colorOrder is in reverse order (unconstrained at front)
5548+
for (auto iter = colorOrder.rbegin(), iterEnd = colorOrder.rend(); iter != iterEnd; ++iter)
55505549
{
5550+
LiveRange* lr = *iter;
55515551
auto lrVar = lr->getVar();
55525552

55535553
//
5554-
// assign register to live ranges
5554+
// assign regiser to live ranges
55555555
//
55565556
if (lr->getPhyReg() == NULL && !lrVar->isSpilled() && !lr->getIsPartialDcl()) // no assigned register yet and not spilled
55575557
{
5558-
G4_Declare* parentDcl = nullptr;
5559-
bool skipParentIntf = false;
5560-
if (lr->hasAllocHint())
5561-
{
5562-
parms.startGRFReg = lr->getAllocHint();
5563-
if (varSplitPass.isPartialDcl(lr->getDcl()))
5564-
{
5565-
parentDcl = varSplitPass.getParentDcl(lr->getDcl());
5566-
auto parentGRF = parentDcl->getRegVar()->getPhyReg();
5567-
if (!parentGRF && parentDcl->getRegVar()->isRegAllocPartaker())
5568-
{
5569-
parentGRF = lrs[parentDcl->getRegVar()->getId()]->getPhyReg();
5570-
}
5571-
if (parentGRF)
5572-
{
5573-
auto siblingNum = varSplitPass.getSiblingNum(lr->getDcl());
5574-
auto parentGRFNum = parentGRF->asGreg()->getRegNum();
5575-
auto forbiddenStart = parentGRFNum + ((siblingNum + 1) * lr->getDcl()->getNumRows());
5576-
auto forbiddenEnd = parentGRFNum + parentDcl->getNumRows();
5577-
lr->markForbidden(forbiddenStart, forbiddenEnd - forbiddenStart);
5578-
skipParentIntf = true;
5579-
}
5580-
}
5581-
}
5582-
55835558
unsigned lr_id = lrVar->getId();
55845559
//
55855560
// compute what registers are already assigned
@@ -5588,6 +5563,7 @@ bool GraphColor::assignColors(ColorHeuristic colorHeuristicGRF, bool doBankConfl
55885563

55895564
std::vector<unsigned int>& intfs = intf.getSparseIntfForVar(lr_id);
55905565
auto weakEdgeSet = intf.getCompatibleSparseIntf(lrVar->getDeclare()->getRootDeclare());
5566+
55915567
for (auto it : intfs)
55925568
{
55935569
LiveRange* lrTemp = lrs[it];
@@ -5598,9 +5574,6 @@ bool GraphColor::assignColors(ColorHeuristic colorHeuristicGRF, bool doBankConfl
55985574
continue;
55995575
}
56005576

5601-
if (skipParentIntf && lrTemp->getDcl() == parentDcl)
5602-
continue;
5603-
56045577
regUsage.updateRegUsage(lrTemp);
56055578
}
56065579
}
@@ -5656,6 +5629,7 @@ bool GraphColor::assignColors(ColorHeuristic colorHeuristicGRF, bool doBankConfl
56565629

56575630
ColorHeuristic heuristic = colorHeuristicGRF;
56585631

5632+
56595633
bool failed_alloc = false;
56605634
G4_Declare* dcl = lrVar->getDeclare();
56615635

@@ -5680,7 +5654,7 @@ bool GraphColor::assignColors(ColorHeuristic colorHeuristicGRF, bool doBankConfl
56805654
// When evenAlignNeeded is true, it is binding for correctness
56815655
bool evenAlignNeeded = gra.isEvenAligned(lrVar->getDeclare());
56825656
BankAlign align = evenAlignNeeded ? BankAlign::Even : BankAlign::Either;
5683-
if (allocFromBanks && !lr->hasAllocHint())
5657+
if (allocFromBanks)
56845658
{
56855659

56865660
if (!isHybrid && oneGRFBankDivision &&
@@ -5694,8 +5668,7 @@ bool GraphColor::assignColors(ColorHeuristic colorHeuristicGRF, bool doBankConfl
56945668
else
56955669
{
56965670
failed_alloc |= !regUsage.assignRegs(highInternalConflict, lr, lr->getForbidden(),
5697-
align, gra.getSubRegAlign(lrVar->getDeclare()), heuristic, lr->getSpillCost(),
5698-
lr->hasAllocHint());
5671+
align, gra.getSubRegAlign(lrVar->getDeclare()), heuristic, lr->getSpillCost());
56995672
}
57005673
}
57015674

@@ -5723,52 +5696,11 @@ bool GraphColor::assignColors(ColorHeuristic colorHeuristicGRF, bool doBankConfl
57235696
spilledLRs.push_back(lr);
57245697
}
57255698
}
5726-
else
5727-
{
5728-
// Allocation succeeded, set hint if this is a split/child dcl
5729-
if (varSplitPass.isSplitDcl(dcl) || varSplitPass.isPartialDcl(dcl))
5730-
{
5731-
varSplitPass.writeHints(dcl, lrs);
5732-
}
5733-
}
57345699
}
57355700
#ifdef DEBUG_VERBOSE_ON
57365701
lr->dump();
57375702
COUT_ERROR << std::endl;
57385703
#endif
5739-
return true;
5740-
};
5741-
5742-
// colorOrder is in reverse order (unconstrained at front)
5743-
for (auto iter = colorOrder.rbegin(), iterEnd = colorOrder.rend(); iter != iterEnd; ++iter)
5744-
{
5745-
auto lr = (*iter);
5746-
bool ret = assignColor(lr);
5747-
5748-
// early exit
5749-
if (!ret)
5750-
return false;
5751-
5752-
if (gra.getIterNo() == 0)
5753-
{
5754-
if(varSplitPass.isSplitDcl(lr->getDcl()))
5755-
{
5756-
// Try allocating children, out of order in hopes
5757-
// of getting a coalescable assignment
5758-
auto children = varSplitPass.getChildren(lr->getDcl());
5759-
for (auto child : *children)
5760-
{
5761-
if (child->getRegVar()->isRegAllocPartaker())
5762-
{
5763-
auto childLR = lrs[child->getRegVar()->getId()];
5764-
if (!childLR->getPhyReg())
5765-
{
5766-
assignColor(childLR);
5767-
}
5768-
}
5769-
}
5770-
}
5771-
}
57725704
}
57735705

57745706
// record RA type
@@ -8934,7 +8866,6 @@ int GlobalRA::coloringRegAlloc()
89348866
{
89358867
std::cout << "--GRF RA iteration " << iterationNo << "--\n";
89368868
}
8937-
setIterNo(iterationNo);
89388869

89398870
resetGlobalRAStates();
89408871

visa/GraphColor.h

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3434
#include <unordered_set>
3535
#include <limits>
3636
#include "RPE.h"
37+
3738
#include "BitSet.h"
38-
#include "VarSplit.h"
3939

4040
#define BITS_DWORD 32
4141
#define SCRATCH_MSG_LIMIT (128 * 1024)
@@ -91,8 +91,6 @@ class LiveRange
9191
AssignedReg reg;
9292
float spillCost;
9393
BankConflict bc = BankConflict::BANK_CONFLICT_NONE;
94-
const static unsigned int UndefHint = 0xffffffff;
95-
unsigned int allocHint = UndefHint;
9694

9795
union {
9896
uint16_t bunch = 0;
@@ -188,10 +186,6 @@ class LiveRange
188186
void setParentLRID(int id) { parentLRID = id; }
189187
unsigned getParentLRID() const { return parentLRID; }
190188

191-
unsigned int getAllocHint() const { return allocHint; }
192-
bool hasAllocHint() const { return allocHint != UndefHint; }
193-
void setAllocHint(unsigned int h) { allocHint = h; }
194-
195189
// From VarBasis
196190
public:
197191
void allocForbidden(vISA::Mem_Manager& mem, bool reserveStackCallRegs, unsigned reserveSpillSize, unsigned rerservedRegNum);
@@ -751,9 +745,6 @@ namespace vISA
751745
// new temps for each reference of spilled address/flag decls
752746
std::unordered_set<G4_Declare*> addrFlagSpillDcls;
753747

754-
// store iteration number for GRA loop
755-
unsigned int iterNo = 0;
756-
757748
void expandFillNonStackcall(uint32_t& numRows, uint32_t& offset, short& rowOffset, G4_SrcRegRegion* header, G4_DstRegRegion* resultRgn, G4_BB* bb, INST_LIST_ITER& instIt);
758749
void expandSpillNonStackcall(uint32_t& numRows, uint32_t& offset, short& rowOffset, G4_SrcRegRegion* header, G4_SrcRegRegion* payload, G4_BB* bb, INST_LIST_ITER& instIt);
759750
void expandFillStackcall(uint32_t& numRows, uint32_t& offset, short& rowOffset, G4_SrcRegRegion* header, G4_DstRegRegion* resultRgn, G4_BB* bb, INST_LIST_ITER& instIt);
@@ -765,10 +756,6 @@ namespace vISA
765756
PhyRegPool& regPool;
766757
PointsToAnalysis& pointsToAnalysis;
767758
FCALL_RET_MAP fcallRetMap;
768-
VarSplitPass* splitPass = nullptr;
769-
770-
void setVarSplitPass(VarSplitPass* p) { splitPass = p; }
771-
VarSplitPass* getVarSplitPass() { return splitPass; }
772759

773760
unsigned int getSubRetLoc(G4_BB* bb)
774761
{
@@ -786,8 +773,6 @@ namespace vISA
786773
void insertCallReturnVar();
787774
void insertSaveAddr(G4_BB*);
788775
void insertRestoreAddr(G4_BB*);
789-
void setIterNo(unsigned int i) { iterNo = i; }
790-
unsigned int getIterNo() { return iterNo; }
791776

792777
G4_Declare* getRetDecl(uint32_t retLoc)
793778
{

0 commit comments

Comments
 (0)