[LLVMdev] LLD: representation of a power of two value

Simon Atanasyan simon at atanasyan.com
Wed Mar 25 00:54:22 PDT 2015

On Wed, Mar 25, 2015 at 3:09 AM, Rui Ueyama <ruiu at google.com> wrote:
> It's not a big deal, but it always annoyed me a bit when I hit it, so I'll
> bring it up here.
> LLD represents an alignment X as log2(X) in some places and just X in other
> places. It's a bit confusing. Because I always think alignments in my mind
> in terms of 1, 2, 4, 8, ..., instead of 2^1, 2^2, 2^3, ..., I'd like to
> propose to always use real values.
> Any objections?

I agree. Every time I deal with alignment in the LLD code I have to
remember how we represent alignment in that case.

Simon Atanasyan

More information about the llvm-dev mailing list