Skip to content

Commit 0cab4e5

Browse files
weiyu-chensys_zuul
authored andcommitted
Yet another bug fix for stack-call fill. We need to make sure subregister for the fill temp is correctly programmed.
Change-Id: I9e0ea2c73853a9127cf4eb3823560c1f8c90f121
1 parent b3dbdfd commit 0cab4e5

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

visa/SpillManagerGMRF.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ SpillManagerGRF::calculateEncAlignedSegment (
772772
unsigned regionDisp = getRegionDisp (region);
773773
unsigned regionByteSize = getRegionByteSize (region, execSize);
774774

775-
if( useScratchMsg_ )
775+
if (need32ByteAlignedOffset())
776776
{
777777
unsigned hwordLB = regionDisp & grfMask();
778778
unsigned hwordRB = hwordLB + G4_GRF_REG_NBYTES;
@@ -782,14 +782,14 @@ SpillManagerGRF::calculateEncAlignedSegment (
782782
hwordRB += blockSize;
783783
}
784784

785-
assert ((hwordRB - hwordLB)/ REG_BYTE_SIZE <= 4);
785+
assert((hwordRB - hwordLB) / REG_BYTE_SIZE <= 4);
786786
start = hwordLB;
787787
end = hwordRB;
788-
type = grfMask ();
788+
type = grfMask();
789789
}
790790
else
791791
{
792-
unsigned owordLB = regionDisp & owordMask ();
792+
unsigned owordLB = regionDisp & owordMask();
793793
unsigned owordRB = owordLB + OWORD_BYTE_SIZE;
794794
unsigned blockSize = OWORD_BYTE_SIZE;
795795

@@ -798,10 +798,10 @@ SpillManagerGRF::calculateEncAlignedSegment (
798798
blockSize *= 2;
799799
}
800800

801-
assert ((owordRB - owordLB)/ REG_BYTE_SIZE <= 4);
801+
assert((owordRB - owordLB) / REG_BYTE_SIZE <= 4);
802802
start = owordLB;
803803
end = owordRB;
804-
type = owordMask ();
804+
type = owordMask();
805805
}
806806
}
807807

@@ -1239,9 +1239,7 @@ SpillManagerGRF::createTransientGRFRangeDeclare (
12391239
height = 1;
12401240
}
12411241

1242-
bool usesStack = builder_->kernel.fg.getIsStackCallFunc() || builder_->kernel.fg.getHasStackCalls();
1243-
1244-
if (useScratchMsg_ || usesStack)
1242+
if (need32ByteAlignedOffset())
12451243
{
12461244
// the message will read/write a minimum of one GRF
12471245
if (height == 1 && width < getGRFSize())

visa/SpillManagerGMRF.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,12 @@ class SpillManagerGRF
844844

845845
return needed;
846846
}
847+
848+
// return true if offset for spill/fill message needs to be 32byte aligned
849+
bool need32ByteAlignedOffset() const
850+
{
851+
return useScratchMsg_ || useSplitSend();
852+
}
847853
};
848854
}
849855
bool isDisContRegion (

0 commit comments

Comments
 (0)