[LLVMdev] SCEV and GEP NSW flag

Andrew Trick atrick at apple.com
Tue Nov 5 20:54:14 PST 2013


On Nov 2, 2013, at 5:43 AM, Hal Finkel <hfinkel at anl.gov> wrote:

>> Along those lines, I’m a little baffled as to why you want an NSW
>> recurrence. You already know the difference is 4*k and k > 0. Isn’t
>> that enough? Is the problem that 4*k may overflow?
> 
> Ah, I forgot to explain, one problem is that I can't divide {((4 * %k) +  %a),+,4}<%for.body> by 4 to get ride of the type size. I was trying to do this in order to make it easier for isLoopEntryGuardedByCond to match the condition, but even dividing by 4 does not work if the recurrence is not <nsw> (as far as I can tell).
> 
>> 
>> Maybe this sort of alias analysis needs to reason about array
>> indices, not addresses.
> 
> Being able to divide by the type sizes would make this easier ;)

Asking for the SCEV of the GEP index instead of the base would seem to make life easier for SCEV and give you everything you need for dependence analysis.

-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131105/46b4d286/attachment.html>


More information about the llvm-dev mailing list