[PATCH] D73131: [IR] Value::getPointerAlignment(): handle pointer constants

Mikhail Lychkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 6 04:56:53 PST 2020


mlychkov added a comment.

Hi Roman,
We faced some side effect of this patch. During processing of getelementptr instruction it may create new user of this instruction. However this user is not actually used by generated code.
As example, during processing of the following instruction

  %3 = load %struct_t*, %struct_t** getelementptr inbounds ([8 x %struct_t*], [8 x %struct_t*]* @globvar, i64 0, i64 0), align 8, !tbaa !16

the following constant expresion is created

  i64 ptrtoint ([8 x %struct_t*]* @globvar to i64) 

Later in one of our passes we change all users of @globvar variable and this extra user is unexpected.

Is this alignment accounting intended to be used for getelementptr instructions too?
If yes then may we cleanup extra user after we get TrailingZeros value?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73131





More information about the llvm-commits mailing list