[llvm-commits] [llvm] r140624 - /llvm/trunk/lib/Target/PTX/PTXAsmPrinter.cpp
Justin Holewinski
justin.holewinski at gmail.com
Wed Sep 28 11:27:54 PDT 2011
On Wed, Sep 28, 2011 at 12:25 PM, Eli Friedman <eli.friedman at gmail.com>wrote:
> On Wed, Sep 28, 2011 at 4:58 AM, Justin Holewinski
> <justin.holewinski at gmail.com> wrote:
> > 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.
>
> log2(1) == 0. log2(2) == 1. Hence, your patch enforces a minimum
> alignment of 2 bytes.
>
Ah, I see the source of the confusion. I was actually fixing the wrong bug.
:)
The log shouldn't even be there, not sure when it made it in. Anyway, its
fixed in r140709 now.
>
> -Eli
>
--
Thanks,
Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110928/a7bf92ed/attachment.html>
More information about the llvm-commits
mailing list