[llvm-commits] [llvm] r140624 - /llvm/trunk/lib/Target/PTX/PTXAsmPrinter.cpp
Justin Holewinski
justin.holewinski at gmail.com
Wed Sep 28 04:58:05 PDT 2011
On Tue, Sep 27, 2011 at 4:01 PM, Eli Friedman <eli.friedman at gmail.com>wrote:
> On Tue, Sep 27, 2011 at 12:25 PM, Justin Holewinski
> <justin.holewinski at gmail.com> wrote:
> > Author: jholewinski
> > Date: Tue Sep 27 14:25:49 2011
> > New Revision: 140624
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=140624&view=rev
> > Log:
> > PTX: Fix case where printed alignment could be 0
> >
> > Modified:
> > llvm/trunk/lib/Target/PTX/PTXAsmPrinter.cpp
> >
> > Modified: llvm/trunk/lib/Target/PTX/PTXAsmPrinter.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXAsmPrinter.cpp?rev=140624&r1=140623&r2=140624&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/PTX/PTXAsmPrinter.cpp (original)
> > +++ llvm/trunk/lib/Target/PTX/PTXAsmPrinter.cpp Tue Sep 27 14:25:49 2011
> > @@ -480,7 +480,7 @@
> > unsigned alignment = gv->getAlignment();
> > if (alignment != 0) {
> > decl += ".align ";
> > - decl += utostr(Log2_32(gv->getAlignment()));
> > + decl += utostr(std::max(1U, Log2_32(gv->getAlignment())));
> > decl += " ";
> > }
>
> This looks wrong: you're making sure the alignment is at least 2 bytes?!
>
No, this is making sure it is at least 1 byte. There were some cases where
the Log2 function was returning 0.
>
> -Eli
>
--
Thanks,
Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110928/d9f0c894/attachment.html>
More information about the llvm-commits
mailing list