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

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 6 09:35:44 PST 2020


jdoerfert added a comment.

In D73131#1861978 <https://reviews.llvm.org/D73131#1861978>, @lebedev.ri wrote:

> In D73131#1861781 <https://reviews.llvm.org/D73131#1861781>, @jdoerfert wrote:
>
> > In D73131#1861624 <https://reviews.llvm.org/D73131#1861624>, @mlychkov wrote:
> >
> > > In D73131#1861595 <https://reviews.llvm.org/D73131#1861595>, @mlychkov wrote:
> > >
> > > > ...
> > > >  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?
> > >
> > >
> > > Or is there a way to perform this computation without const_cast?
> >
> >
> > The problem is `ConstantExpr::getPtrToInt`. Do we striclty need that?
>
>
> That is the workhorse here, we can't get around using it.
>
> Without seeing the code where this is causing trouble i'm somewhat unsure
>  on how this is a problem, or how to test that the fix would actually fix it.
>  Perhaps, after computing `TrailingZeros`, we need to explicitly DCE `CstInt`?


That'll probably work as well. If `CstInt` has 0 users it can be removed.


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