[llvm-commits] [llvm] r74624 - in /llvm/trunk: include/llvm/CodeGen/ include/llvm/Target/ lib/Target/ARM/ lib/Target/Alpha/ lib/Target/CellSPU/ lib/Target/IA64/ lib/Target/MSP430/ lib/Target/Mips/ lib/Target/PIC16/ lib/Target/PowerPC/ lib/Target/

Bill Wendling isanbard at gmail.com
Wed Jul 1 23:38:40 PDT 2009


On Jul 1, 2009, at 8:18 PM, Chris Lattner wrote:

> On Jul 1, 2009, at 6:40 PM, Daniel Dunbar wrote:
>
>> I probably missed the backstory here, but wouldn't it be better for  
>> us
>> to consistently use byte alignment?
>>
>> Some contexts will always need non-power of two alignment, and I  
>> think
>> there is value in standardizing on one form. The situation now is we
>> have code like TargetData::get...Alignment which returns bytes, and
>> MachineFunction::get...Alignment which returns log2. Alternately we
>> could include Log2 in the name...
>
> I vote for keeping it in log2 and standardizing on log2 form.  The
> reason is that it takes less space to represent, it is impossible to
> store something that is not a pow2, and it is cheaper to convert from
> log2 -> bytes than from bytes->log2.
>
I vote for whatever causes me the least amount of work. :-)

Just kidding.

I would love to have it standardized. And I agree with Chris's  
assessment. Going from log2 to bytes is much easier.

-bw



More information about the llvm-commits mailing list