This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Identifying Chain of Recurrence


On Fri, May 29, 2015 at 11:14 PM, Pritam Gharat
<pritam01gharat@gmail.com> wrote:
> I am writing a Simple IPA Pass which is inserted after ipa-pta. This
> pass identifies whether a chain of recurrence is built by gcc or not.
> I have used tree_is_chrec(t) to check if t represents chain of
> recurrence and function find_var_scev_info(bb, var)  to obtain the
> scev information generated (which comprises of chrec information).
> However, find_var_scev_info() is a static function and cannot be
> called from my plugin.
find_var_scev_info is for internal use only.   I think the proper
interface is simple_iv.  You may refer to other users of that
interface in GCC.
Also, please don't top-reply the message.

Thanks,
bin
>
> Is there any alternative way to get the chain of recurrence
> information? Or do we need to change the gcc source code by making the
> function find_var_scev_info() non-static and recompiling the source
> code?


>
> Thanks,
> Pritam Gharat
>
> On Fri, May 29, 2015 at 10:34 AM, Bin.Cheng <amker.cheng@gmail.com> wrote:
>> On Fri, May 29, 2015 at 12:41 PM, Pritam Gharat
>> <pritam01gharat@gmail.com> wrote:
>>> GCC builds a chain of recurrence to capture a pattern in which an
>>> array is accessed in a loop. Is there any function which identifies
>>> that gcc has built a chain of recurrence? Is this information
>>> associated to the gimple assignment which accesses the array elements?
>>>
>> GCC analyzes evolution of scalar variables on SSA representation.
>> Each ssa var is treated as unique and can be analyzed.  If the address
>> expression itself is a ssa var, it can be analyzed by scev; otherwise,
>> the users of scev have to compute by themselves on the bases of other
>> scev vars.  For example, address of MEM[scev_var] can be analyzed by
>> scev; while address of MEM[invariant_base+scev_iv] is computed by
>> users.  Well, at least this is how IVOPT works.  You can refer to
>> top-file comment in tree-scalar-evolution.c for detailed information.
>> General routines for chain of recurrence is in file tree-chrec.c.
>>
>> Thanks,
>> bin
>>>
>>> Thanks,
>>> Pritam Gharat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]