[Beignet] [PATCH] do constant folding for kernel struct args

Yang, Rong R rong.r.yang at intel.com
Tue Jun 13 08:58:55 UTC 2017


foldFunctionStructArgConstOffset is called before the lowerFunctionArguments.
If foldFunctionStructArgConstOffset is wrong, the INDIRECT_MOV generated in lowerFunctionArguments also wrong.

I afraid the following ir:

BB2:
LOADI %30, 4
Add %20, %10, %30    //%10 is a struct argument
MOV %22, %20   //phi-mov

BB3:
LOADI %31, 8
Add %21, %11, %31    //%11 is another struct argument
MOV %22, %21   //phi-mov

BB4:
LOADI %32, 4
Add %33, %22, %32    

Will be converted to:
LOADI %42, 8
Add %33, %10, %42

If so, the lowerFunctionArguments will wrong.

> -----Original Message-----
> From: Guo, Yejun
> Sent: Tuesday, June 13, 2017 16:39
> To: Yang, Rong R <rong.r.yang at intel.com>; Wang, Rander
> <rander.wang at intel.com>; Pan, Xiuli <xiuli.pan at intel.com>;
> beignet at lists.freedesktop.org
> Subject: RE: [Beignet] [PATCH] do constant folding for kernel struct args
> 
> I just tried such kernel, and the generated GEN IR is INDIRECT_MOV, it has
> nothing to do with this patch.
> 
> Thanks
> Yejun
> 
> -----Original Message-----



More information about the Beignet mailing list