[PATCH] D15680: [Polly] Do not check JSON alignment of scalar accesses

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 09:21:22 PST 2016


2016-01-15 18:00 GMT+01:00 Tobias Grosser <tobias at grosser.es>:
> On 01/15/2016 05:53 PM, Michael Kruse wrote:
>>
>> This revision was automatically updated to reflect the committed changes.
>> Closed by commit rL257904: Do not check JSON alignment of scalar accesses
>> (authored by Meinersbur).
>>
>> Changed prior to commit:
>>    http://reviews.llvm.org/D15680?vs=43337&id=44998#toc
>>
>> Repository:
>>    rL LLVM
>>
>> http://reviews.llvm.org/D15680
>>
>> Files:
>>    polly/trunk/lib/Exchange/JSONExporter.cpp
>>
>> Index: polly/trunk/lib/Exchange/JSONExporter.cpp
>> ===================================================================
>> --- polly/trunk/lib/Exchange/JSONExporter.cpp
>> +++ polly/trunk/lib/Exchange/JSONExporter.cpp
>> @@ -304,33 +304,35 @@
>>         isl_id *OutId = isl_map_get_tuple_id(currentAccessMap,
>> isl_dim_out);
>>         newAccessMap = isl_map_set_tuple_id(newAccessMap, isl_dim_out,
>> OutId);
>>
>> -      // We keep the old alignment, thus we cannot allow accesses to
>> memory
>> -      // locations that were not accessed before if the alignment of the
>> access
>> -      // is not the default alignment.
>> -      bool SpecialAlignment = true;
>> -      if (LoadInst *LoadI =
>> dyn_cast<LoadInst>(MA->getAccessInstruction())) {
>> -        SpecialAlignment =
>> -            DL.getABITypeAlignment(LoadI->getType()) !=
>> LoadI->getAlignment();
>> -      } else if (StoreInst *StoreI =
>> -                     dyn_cast<StoreInst>(MA->getAccessInstruction())) {
>> -        SpecialAlignment =
>> -            DL.getABITypeAlignment(StoreI->getValueOperand()->getType())
>> !=
>> -            StoreI->getAlignment();
>> -      }
>> +      if (MA->isArrayKind()) {
>
>
> An early 'continue' would help to keep the alignment low, e.g.,
>
> if (!MA->isArrayKind())
>   continue();

... and break the code because there part behind the conditional in
the same loop is not executed anymore for array kinds.

Except you want to load only array kinds. In that case the the test
should come a lot earlier in the code. But this is a change in
behaviour I did not want to address.

Michael


More information about the llvm-commits mailing list