[LLVMdev] Adding legal integer sizes to TargetData

Dale Johannesen dalej at apple.com
Mon Feb 2 13:33:25 PST 2009


On Feb 2, 2009, at 1:29 PMPST, Chris Lattner wrote:

>
> On Feb 2, 2009, at 1:26 PM, Dale Johannesen wrote:
>
>>
>> On Feb 1, 2009, at 11:06 PMPST, Chris Lattner wrote:
>>
>>> Now that 2.5 is about to branch, I'd like to bring up one of Scott's
>>> favorite topics: certain optimizers widen or narrow arithmetic,
>>> without regard for whether the type is legal for the target.  In his
>>> specific case, instcombine is turning an i32 multiply into an i64
>>> multiply in order to eliminate a cast.  This does simplify/reduce  
>>> the
>>> number of IR operations, but an i64 multiply is dramatically more
>>> expensive than an i32 multiply on CellSPU.
>>
>> I basically agree with Scott on this:  we shouldn't reintroduce
>> types that
>> are illegal for the target after Legalize.
>
> I'm sorry, to be clear, this is mostly talking about an instcombine
> change.  Obviously anything in codegen should respect current
> restrictions.  The question is whether the mid-level optimizer should
> try to avoid introducing illegal types.

I understand; I was stating a general principle, which I believe to be  
a good one.




More information about the llvm-dev mailing list