[PATCH] D112370: [BasicAA] Use index size instead of pointer size

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 12:14:34 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/BasicAliasAnalysis.cpp:557
 
-  unsigned MaxPointerSize = DL.getMaxPointerSizeInBits();
   DecomposedGEP Decomposed;
----------------
reames wrote:
> The use of maximum pointer/index size seems suspect here.  Shouldn't we be working in the bitwidth of a single AS at all times?  
GEP decomposition looks through address space casts, so the index size can change. It does mostly work with the index size of a single AS and then sext up to the maximum size, though the precise way it does so is not quite correct in some respects (wrt sext/mul commutativity and scale adjustment -- fixing this needs some more preliminary work though).

It would certainly make things easier if we could get away with not looking through address space casts, but I'm not sure that's viable.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112370/new/

https://reviews.llvm.org/D112370



More information about the llvm-commits mailing list