[llvm-commits] [llvm] r151553 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/aligned-overread.ll test/Analysis/BasicAA/global-size.ll

Eli Friedman eli.friedman at gmail.com
Mon Feb 27 15:22:14 PST 2012


On Mon, Feb 27, 2012 at 2:24 PM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Eli,
>
>> --- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
>> +++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Mon Feb 27 14:46:07 2012
> ...
>> +
>> +  if (!AccessTy->isSized())
>> +    return AliasAnalysis::UnknownSize;
>> +
>> +  uint64_t Size = TD.getTypeAllocSize(AccessTy);
>> +  if (RoundToAlign) {
>> +    if (!Align)
>> +      return AliasAnalysis::UnknownSize;
>
> Align being zero usually means: use the ABI alignment.  In which case the size
> just Size since getTypeAllocSize is already rounded by the ABI alignment.  This
> is the case if the alignment comes from a GlobalVariable at least.  I don't know
> what the rule is for a AllocaInst but hopefully the same.

The rule is the same for all of the relevant places, as far as I know; r151584.

-Eli




More information about the llvm-commits mailing list