This is the mail archive of the
mailing list for the GCC project.
Re: Identifying Chain of Recurrence
- From: "Bin.Cheng" <amker dot cheng at gmail dot com>
- To: Pritam Gharat <pritam01gharat at gmail dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 29 May 2015 13:04:51 +0800
- Subject: Re: Identifying Chain of Recurrence
- Authentication-results: sourceware.org; auth=none
- References: <CAPHYrQXaHg-kC_1wuW8Os-OXiJB3t9a90NXyrBp9Wr0hOARPHA at mail dot gmail dot com>
On Fri, May 29, 2015 at 12:41 PM, Pritam Gharat
> 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.
> Pritam Gharat