@@ -10674,7 +10674,7 @@ enum SplitBounds : unsigned {
10674
10674
HiRBound = 127
10675
10675
};
10676
10676
10677
- bool isCandidateDecl (G4_Declare *Dcl)
10677
+ static bool isCandidateDecl (G4_Declare *Dcl, const IR_Builder& builder )
10678
10678
{
10679
10679
G4_Declare *RootDcl = Dcl->getRootDeclare ();
10680
10680
if (RootDcl->getRegFile () != G4_GRF)
@@ -10688,6 +10688,13 @@ bool isCandidateDecl(G4_Declare *Dcl)
10688
10688
if (RootDcl->getAddressed ())
10689
10689
return false ;
10690
10690
10691
+ if (builder.isPreDefArg (RootDcl) || builder.isPreDefRet (RootDcl))
10692
+ {
10693
+ return false ;
10694
+ }
10695
+
10696
+ // ToDo: add more special declares to exclude list
10697
+
10691
10698
return true ;
10692
10699
}
10693
10700
@@ -10791,7 +10798,7 @@ void Optimizer::splitVariables()
10791
10798
fg.globalOpndHT .isOpndGlobal (Dst))
10792
10799
continue ;
10793
10800
auto Dcl = Dst->getTopDcl ();
10794
- if (!Dcl || !isCandidateDecl (Dcl))
10801
+ if (!Dcl || !isCandidateDecl (Dcl, builder ))
10795
10802
continue ;
10796
10803
10797
10804
unsigned LBound = Dst->getLeftBound ();
@@ -10942,7 +10949,7 @@ void Optimizer::split4GRFVars()
10942
10949
{
10943
10950
if (dcl->getAliasDeclare () == nullptr )
10944
10951
{
10945
- if (isCandidateDecl (dcl))
10952
+ if (isCandidateDecl (dcl, builder ))
10946
10953
{
10947
10954
if (varToSplit.find (dcl) == varToSplit.end ())
10948
10955
{
@@ -10960,7 +10967,7 @@ void Optimizer::split4GRFVars()
10960
10967
// must appear before its alias decls
10961
10968
uint32_t offset = 0 ;
10962
10969
G4_Declare* rootDcl = dcl->getRootDeclare (offset);
10963
- if (offset != 0 && isCandidateDecl (rootDcl))
10970
+ if (offset != 0 && isCandidateDecl (rootDcl, builder ))
10964
10971
{
10965
10972
varToSplit.erase (rootDcl);
10966
10973
}
0 commit comments