[LLVMdev] DependenceAnalysis and PR14241

Tobias Grosser tobias at grosser.es
Fri Nov 2 11:08:49 PDT 2012


On 11/02/2012 11:02 AM, Hal Finkel wrote:
> ----- Original Message -----
>> From: "Tobias Grosser" <tobias at grosser.es>
>> To: "preston briggs" <preston.briggs at gmail.com>
>> Cc: "Benjamin Kramer" <benny.kra at gmail.com>, "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
>> Sent: Friday, November 2, 2012 12:56:53 PM
>> Subject: Re: [LLVMdev] DependenceAnalysis and PR14241
>>
>> On 11/02/2012 10:21 AM, Preston Briggs wrote:
>>>
>>> My initial guess is that a conservative fix is quick and small
>>> (make
>>> sure the underlying pointers are loop invariant, otherwise give
>>> up). A
>>> better approach would be to somehow turn code like the example into
>>> array references that can be analyzed. I'll need to think about
>>> this and
>>> do some reading.
>>
>> Hi Preston,
>>
>> I looked at this test case. I am not sure what you are exactly doing,
>> but I have the feeling you start from the getelementptr instruction.
>> If
>> you directly pass the pointer that is pointed to by the loads and
>> stores
>> to SCEV, there should just be a single base pointer %s in the
>> resulting
>> SCEVS. You can then extract this base pointer, subtract it from the
>> scev
>> and analyze the remaining scev as subscript. The base pointer in this
>> test case is loop invariant.
>
> Does const SCEV *getPointerBase(const SCEV *V) do this?

It give you the base pointer. Yes.

Tobi



More information about the llvm-dev mailing list