[PATCH] [SCEV][LoopVectorize] Allow ScalarEvolution to make assumptions about overflows

Silviu Baranga Silviu.Baranga at arm.com
Mon Jun 22 03:39:02 PDT 2015


Hi Andy,

Would you be happy to review this? (http://reviews.llvm.org/D10161)

Cheers,
Silviu

>> -----Original Message-----
>> From: Sanjoy Das [mailto:sanjoy at playingwithpointers.com]
>> Sent: 14 June 2015 23:21
>> To: Silviu Baranga; Andrew Trick
>> Cc: llvm-commits at cs.uiuc.edu; Adam Nemet
>> Subject: Re: [PATCH] [SCEV][LoopVectorize] Allow ScalarEvolution to make
>> assumptions about overflows
>> 
>> 
>> > On Jun 11, 2015, at 2:57 AM, Silviu Baranga <Silviu.Baranga at arm.com>
>> wrote:
>> >
>> > Ping? (http://reviews.llvm.org/D10161)
>> >
>> > @Sanjoy: would you be willing to review this? It looks like you might
>> > be the person to do it.
>> 
>> Given that this is a major change to SCEV, I think Andy (CC’ed) is the right
>> reviewer.
>> 
>> — Sanjoy
>> 
>> 
>> >
>> > Also CC'ing Adam as he might be interested as well.
>> >
>> > Thanks,
>> > Silviu
>> >
>> >
>> >>> -----Original Message-----
>> >>> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-
>> >>> bounces at cs.uiuc.edu] On Behalf Of silviu.baranga at arm.com
>> >>> Sent: 01 June 2015 17:16
>> >>> To: Silviu Baranga
>> >>> Cc: llvm-commits at cs.uiuc.edu
>> >>> Subject: [PATCH] [SCEV][LoopVectorize] Allow ScalarEvolution to make
>> >>> assumptions about overflows
>> >>>
>> >>> Add a new pass - AssumingScalarEvolution - that extends SCEV, but
>> >>> can make assumptions and generate code that can check these
>> assumptions.
>> >>> This pass uses the normal ScalarEvolution pass for anything outside
>> >>> the current analyzed loop, but uses its own data structures to
>> >>> handle the SCEVs within the loop. For now, the pass assumes that
>> >>> chrec expressions will not overflow.
>> >>>
>> >>> The AssumingScalarEvolution pass can add checks for the made
>> >>> assumptions, so that a loop can be versioned.
>> >>>
>> >>> We use this pass in order to add runtime overflow checks in the Loop
>> >>> Vectorize pass of expressions which can in theory overflow and would
>> >>> prevent the vectorization a loop. Also note that the runtime checks
>> >>> will almost always pass, since having an overflow is usually a sign
>> >>> of a coding error on the part of user.
>> >>>
>> >>> The main reasons behind inheriting from ScalarEvolution:
>> >>> Since ScalarEvolution maintains its own cache for various results,
>> >>> making any assumption would likely require invalidating the entire
>> cache.
>> >>>
>> >>> This way we can use the new pass as an almost drop-in replacement
>> >>> for ScalarEvolution. The users that are doing a transformation would
>> >>> have to know about it in order to add the checks.
>> >>>
>> >>> However, there are probably a lot more ways in which this could be
>> >>> implemented.
>> >>>
>> >>> Any comments are much appreciated!
>> >>>
>> >>> Thanks,
>> >>> Silviu
>> >>>
>> >>> http://reviews.llvm.org/D10161
>> >>>
>> >>> Files:
>> >>>  include/llvm/Analysis/LoopAccessAnalysis.h
>> >>>  include/llvm/Analysis/ScalarEvolution.h
>> >>>  include/llvm/InitializePasses.h
>> >>>  lib/Analysis/Analysis.cpp
>> >>>  lib/Analysis/LoopAccessAnalysis.cpp
>> >>>  lib/Analysis/ScalarEvolution.cpp
>> >>>  lib/Transforms/Vectorize/LoopVectorize.cpp
>> >>>  test/Transforms/LoopVectorize/safegep.ll
>> >>>  test/Transforms/LoopVectorize/scev-overflow-check.ll
>> >>>  test/Transforms/LoopVectorize/version-mem-access.ll
>> >>>
>> >>> EMAIL PREFERENCES
>> >>>  http://reviews.llvm.org/settings/panel/emailpreferences/
>> >
>> >







More information about the llvm-commits mailing list