Skip to content

Commit 02fb853

Browse files
pratikasharZuul
authored and
Zuul
committed
Improve support for spill/fill intrinsics in presence of stack call
Change-Id: I9a7d6b5ef9deafefbe0fd77cc5af0c5346780327
1 parent ba66269 commit 02fb853

File tree

5 files changed

+423
-249
lines changed

5 files changed

+423
-249
lines changed

visa/GraphColor.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -9136,7 +9136,8 @@ int GlobalRA::coloringRegAlloc()
91369136
}
91379137
#endif
91389138
bool disableSpillCoalecse = builder.getOption(vISA_DisableSpillCoalescing) ||
9139-
builder.getOption(vISA_FastSpill) || builder.getOption(vISA_Debug);
9139+
builder.getOption(vISA_FastSpill) || builder.getOption(vISA_Debug) ||
9140+
!useScratchMsgForSpill;
91409141
if (!reserveSpillReg && !disableSpillCoalecse && builder.useSends())
91419142
{
91429143
CoalesceSpillFills c(kernel, liveAnalysis, coloring, spillGRF, iterationNo, rpe, *this);

visa/GraphColor.h

+5
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,11 @@ namespace vISA
744744
// new temps for each reference of spilled address/flag decls
745745
std::unordered_set<G4_Declare*> addrFlagSpillDcls;
746746

747+
void expandFillNonStackcall(uint32_t& numRows, uint32_t& offset, short& rowOffset, G4_SrcRegRegion* header, G4_DstRegRegion* resultRgn, G4_BB* bb, INST_LIST_ITER& instIt);
748+
void expandSpillNonStackcall(uint32_t& numRows, uint32_t& offset, short& rowOffset, G4_SrcRegRegion* header, G4_SrcRegRegion* payload, G4_BB* bb, INST_LIST_ITER& instIt);
749+
void expandFillStackcall(uint32_t& numRows, uint32_t& offset, short& rowOffset, G4_SrcRegRegion* header, G4_DstRegRegion* resultRgn, G4_BB* bb, INST_LIST_ITER& instIt);
750+
void expandSpillStackcall(uint32_t& numRows, uint32_t& offset, short& rowOffset, G4_SrcRegRegion* payload, G4_BB* bb, INST_LIST_ITER& instIt);
751+
747752
public:
748753
G4_Kernel& kernel;
749754
IR_Builder& builder;

visa/RegAlloc.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1834,6 +1834,9 @@ bool LivenessAnalysis::writeWholeRegion(G4_BB* bb,
18341834
return false;
18351835
}
18361836

1837+
if (inst->isFCall())
1838+
return true;
1839+
18371840
// Flags may be partially written when used as the destination
18381841
// e.g., setp (M5_NM, 16) P11 V97(8,0)<0;1,0>
18391842
// It can be only considered as a complete kill

0 commit comments

Comments
 (0)