[llvm] r215343 - In LVI(Lazy Value Info), originally value on a BB can only be caculated once,

Hans Wennborg hans at chromium.org
Fri Nov 21 15:30:41 PST 2014


On Fri, Nov 21, 2014 at 3:13 PM, Pete Cooper <peter_cooper at apple.com> wrote:
> Thanks Hans!  I was just trying to reduce it.
>
> I’ll take a look now.  Probably something i’ve done is breaking when there’s loops.

I think the problem is that when we're resetting BBLV to Undefined,
that value goes in the cache, hasBlockValue() is now returning true
for that value, and others might pick it up - and Undefined is the
wrong value.

What we'd really want to do is to remove BBLV from the cache until
we're done computing its value, but then we're not terminating cycles
anymore. Hmm.


>> On Nov 21, 2014, at 3:12 PM, Hans Wennborg <hans at chromium.org> wrote:
>>
>> On Thu, Nov 20, 2014 at 7:51 PM, Pete Cooper <peter_cooper at apple.com> wrote:
>>> But something is going wrong. I'm attaching a reduction of the problem
>>> I saw. With your patch applied, using "clang -O2 /tmp/a.cc", the
>>> attached program goes into an infinite loop.
>>>
>>> Thanks!  I’ll take a look.
>>
>> I've reduced it (at least a little..) into an IR test (attached). With
>> your patch applied, run through opt like so:
>>
>>  $ opt -correlated-propagation /tmp/reduced.ll -S
>>
>> Note how the definition of %i.1 changes from
>>
>>  %i.1 = phi i32 [ %add, %for.body ], [ %i.07, %if.then ]
>>
>> to
>>
>>  %i.1 = phi i32 [ 2, %for.body ], [ 1, %if.then ]
>>
>> which is not correct.
>>
>> - Hans
>> <reduced.ll>
>




More information about the llvm-commits mailing list