[polly] block generators: fix insertion of values in BBMap

Tobias Grosser tobias at grosser.es
Fri May 24 10:29:49 PDT 2013


On 05/24/2013 10:21 AM, Sebastian Pop wrote:
> Tobias Grosser wrote:
>> On 05/24/2013 03:09 AM, Will Dietz wrote:
>>> The error is likely due to BBMap[Load] being evaluated first (creating
>>> a {Load -> uninitialized } entry in the DenseMap), then
>>> generateScalarLoad eventually accesses the same element and finds it
>>> to be NULL (DenseMap[Old])..  Offhand I'm not sure if this is
>>> guaranteed to be NULL or if it's uninitialized and happens to be NULL.
>>>
>>> The same issue can also go wrong in an even worse way: the second
>>> DenseMap access can trigger a rehash and *invalidate* the an earlier
>>> evaluated expression (for example LHS of the assignment), leading to a
>>> crash when performing the assignment store.
>>
>
> Thanks Will for your explanations.
>
>> Hey Will,
>>
>> this was exactly the explanation I was missing. Thanks a lot.
>>
>> Sebastian, if this helps you to create or derive a small test case,
>
> I was not able to reproduce this problem in the current tree: you have to check
> out a llvm+polly tree from mid April and run the nightly testsuite to get some
> benchmarks failing because of this bug.  I committed the patch with a long
> commit message explaining why we have to pre-compute elements before inserting
> them in the map.

For the record this was committed in r182655.

Thanks for committing it.
Tobias




More information about the llvm-commits mailing list