File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -8353,19 +8353,36 @@ bool G4_INST::canSrcBeAccAfterHWConform(Gen4_Operand_Number opndNum) const
8353
8353
G4_SrcRegRegion* src = getSrc (srcId)->asSrcRegRegion ();
8354
8354
8355
8355
// dst must be GRF-aligned
8356
- if (( getDst ()-> getLinearizedStart () % getBuilder (). numEltPerGRF <Type_UB>()) != 0 )
8356
+ if (G4_VarBase* base = dst-> getBase () )
8357
8357
{
8358
- if (!(isMixedMode () && builder.getPlatform () == Xe_XeHPSDV))
8359
- return false ;
8358
+ if (base->isRegVar ())
8359
+ {
8360
+ if (base->asRegVar ()->isPhyRegAssigned ())
8361
+ {
8362
+ if ((dst->getLinearizedStart () % getBuilder ().numEltPerGRF <Type_UB>()) != 0 )
8363
+ {
8364
+ if (!(isMixedMode () && builder.getPlatform () == Xe_XeHPSDV))
8365
+ return false ;
8366
+ }
8367
+ }
8368
+ else
8369
+ {
8370
+ // If the destination offset is not GRF aligned, such as has sub register offset, the src cannot be replaced with ACC
8371
+ if (!builder.isOpndAligned (dst, getBuilder ().numEltPerGRF <Type_UB>()))
8372
+ {
8373
+ return false ;
8374
+ }
8375
+ }
8376
+ }
8360
8377
}
8361
8378
8362
8379
// check that src0 and dst have the same type/alignment
8363
- auto dstEltSize = getDst () ->getHorzStride () * getDst () ->getTypeSize ();
8380
+ auto dstEltSize = dst ->getHorzStride () * dst ->getTypeSize ();
8364
8381
if (dstEltSize > TypeSize (src->getType ()))
8365
8382
{
8366
8383
return false ;
8367
8384
}
8368
- else if (isLowPrecisionFloatTy (getDst () ->getType ()) && src->getType () == Type_F &&
8385
+ else if (isLowPrecisionFloatTy (dst ->getType ()) && src->getType () == Type_F &&
8369
8386
dstEltSize == 2 )
8370
8387
{
8371
8388
if (builder.relaxedACCRestrictions ())
You can’t perform that action at this time.
0 commit comments