Skip to content

Commit 1251723

Browse files
weiyu-chensys_zuul
authored and
sys_zuul
committed
Make scalar half-float variables even-word aligned on BDW.
Change-Id: I2b0ab81b1f72af4f84629c3c6ee3bfd1c57b0082
1 parent 2f8b90a commit 1251723

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

visa/GraphColor.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10507,6 +10507,18 @@ void GlobalRA::fixAlignment()
1050710507
}
1050810508
}
1050910509

10510+
if (getGenxPlatform() == GENX_BDW)
10511+
{
10512+
// BDW requires even_word alignment for scalar HF variables
10513+
for (auto dcl : kernel.Declares)
10514+
{
10515+
if (dcl->getElemType() == Type_HF && dcl->getSubRegAlign() == Any)
10516+
{
10517+
setSubRegAlign(dcl, Even_Word);
10518+
}
10519+
}
10520+
}
10521+
1051010522
// ToDo: remove these as it should be done by HWConformity
1051110523
for (auto BB : kernel.fg)
1051210524
{

visa/HWConformity.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7243,7 +7243,7 @@ void HWConformity::helperGenerateTempDst(
72437243
G4_DstRegRegion *dstRegion = builder.Create_Dst_Opnd_From_Dcl(dcl, hStride);
72447244
inst->setDest(dstRegion);
72457245

7246-
RegionDesc* region = builder.createRegionDesc(execSize*hStride, execSize, hStride);
7246+
RegionDesc* region = execSize == 1 ? builder.getRegionScalar() : builder.createRegionDesc(execSize*hStride, execSize, hStride);
72477247
G4_SrcRegRegion *srcRegion = builder.Create_Src_Opnd_From_Dcl(dcl, region);
72487248

72497249
//creating a mov from temp dst to final destination using original options of fixed instruction

0 commit comments

Comments
 (0)