[llvm] 44d63b7 - Revert "[Local] Simplify the alignment limits in getOrEnforceKnownAlignment. NFCI"

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 18 13:41:15 PDT 2020


Yeah I think its a similar issue. Either need to declare them or not use
std::min.

~Craig


On Sat, Apr 18, 2020 at 1:36 PM Roman Lebedev <lebedev.ri at gmail.com> wrote:

> Hmm, sorry about that, linking issues are never fun.
> Tools do link to Core, right?
> This might need a fix similar to
> https://reviews.llvm.org/rGa8c3608a27a82cf1c66f33b96a06423fe0e708fc,
> i.e. add declarations for Value::MaxAlignmentExponent,
> Value::MaximumAlignment into Value.cpp
>
> Roman
>
> On Sat, Apr 18, 2020 at 11:24 PM Craig Topper via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
> >
> >
> > Author: Craig Topper
> > Date: 2020-04-18T13:23:29-07:00
> > New Revision: 44d63b7528e4142bda9f3daba9c11cb460cb7d77
> >
> > URL:
> https://github.com/llvm/llvm-project/commit/44d63b7528e4142bda9f3daba9c11cb460cb7d77
> > DIFF:
> https://github.com/llvm/llvm-project/commit/44d63b7528e4142bda9f3daba9c11cb460cb7d77.diff
> >
> > LOG: Revert "[Local] Simplify the alignment limits in
> getOrEnforceKnownAlignment. NFCI"
> >
> > This reverts commit e00cfe254d99629ec344031adfe1878a84f3b0b3.
> >
> > Seems to be causing a linker error on the build bots.
> >
> > Added:
> >
> >
> > Modified:
> >     llvm/lib/Transforms/Utils/Local.cpp
> >
> > Removed:
> >
> >
> >
> >
> ################################################################################
> > diff  --git a/llvm/lib/Transforms/Utils/Local.cpp
> b/llvm/lib/Transforms/Utils/Local.cpp
> > index b013b4681087..b9dff8c02ce4 100644
> > --- a/llvm/lib/Transforms/Utils/Local.cpp
> > +++ b/llvm/lib/Transforms/Utils/Local.cpp
> > @@ -1215,11 +1215,13 @@ unsigned llvm::getOrEnforceKnownAlignment(Value
> *V, unsigned PrefAlign,
> >
> >    // Avoid trouble with ridiculously large TrailZ values, such as
> >    // those computed from a null pointer.
> > -  // LLVM doesn't support alignments larger than (1 <<
> MaxAlignmentExponent).
> > -  TrailZ = std::min(TrailZ, Value::MaxAlignmentExponent);
> > +  TrailZ = std::min(TrailZ, unsigned(sizeof(unsigned) * CHAR_BIT - 1));
> >
> >    unsigned Align = 1u << std::min(Known.getBitWidth() - 1, TrailZ);
> >
> > +  // LLVM doesn't support alignments larger than this currently.
> > +  Align = std::min(Align, +Value::MaximumAlignment);
> > +
> >    if (PrefAlign > Align)
> >      Align = enforceKnownAlignment(V, Align, PrefAlign, DL);
> >
> >
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200418/348a5c4e/attachment.html>


More information about the llvm-commits mailing list