[LLVMdev] inline asm semantics: output constraint width smaller than input

Chris Lattner clattner at apple.com
Tue Jan 27 14:20:56 PST 2009


On Jan 27, 2009, at 1:17 PM, Török Edwin wrote:

> On 2009-01-27 23:00, Chris Lattner wrote:
>> Right, the interesting wrinkle is that I think llvm's codegen should
>> only see matching constraints of the same type.  If the front-end  
>> sees
>> an i8 tied to an i32, it should extend the i8 or do whatever else it
>> needs to do.
>>
>
> My only concern is whether codegen will be able to optimize away extra
> extensions/truncations or not?

For truncates, yes, extensions no.

>
> Consider  an i8 input, and i32 output. If the frontend extends the  
> i8 so
> that types match, the codegen should optimize away the extend  
> eventually.
> Otherwise we end up with useless extends in the generated assembly.

The extend could be easily optimized away if llvm ir had a concept of  
"any extend" like codegen does.

-Chris



More information about the llvm-dev mailing list