[llvm-commits] [llvm] r46485 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/AsmPrinter.cpp lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h

Chris Lattner clattner at apple.com
Mon Jan 28 21:57:06 PST 2008


On Jan 28, 2008, at 9:24 PM, Dale Johannesen wrote:
>> Can this be done in llvm-gcc?  It seems better to only expose
>> 'simplified' constraints to the llvm code generator.  This means the
>> target hooks would become wonderful macros in i386.h for example, but
>> that seems tolerable.
>
> Sure, but you'd have to reimplement it in clang (etc).  I think it's
> better to have it in one place.  (If you're thinking we  don't need to
> support this in clang eventually, I don't believe it, alas.)

Right, clang eventually needs full inline asm support, but it also  
needs a lot of other stuff (such as better target parameterization of  
constraints etc) that baking this stuff into the LLVM codegen's don't  
help with.

When we go for full clang inline asm handling, I'm hoping that we'll  
have much better abstractions that GCC does, so this functionality  
won't be hard to support.

>> It also might be possible to iterate over the constraint letters
>> somehow in GCC, which would make it possible to implement this in a
>> target independent way.
>
> In llvm you mean maybe?  Could be, I didn't look at that closely.  I
> know there are some collisions between targets of machine-dependent
> constraint letters, but the semantics can't be too different or reload
> would screw up; it might be doable.

Nope, I meant in GCC.  GCC "knows" the current target (because all the  
#defines are baked in), I don't know if it provides a good way to  
iterate over the target-specific letters though.

> That said, I'm not particularly happy with the implementation I wound
> up with, not neat-looking at all and there's probably cases that
> aren't handled the same as gcc.  I don't think there's a silver bullet
> though.

I agree that there is unlikely to be a silver bullet,

-Chris



More information about the llvm-commits mailing list