[llvm-commits] [llvm] r151553 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/aligned-overread.ll test/Analysis/BasicAA/global-size.ll
Duncan Sands
baldrick at free.fr
Mon Feb 27 14:24:06 PST 2012
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.
Ciao, Duncan.
More information about the llvm-commits
mailing list