[llvm-dev] [GlobalISel] Extended inline assembler support

Konstantin Schwarz via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 6 03:11:36 PDT 2020


Hi!

So far, GlobalISel only supports very basic inline assembler constructs 
(no input/output operands, only simple memory clobbers).

In [0], I'm adding support for generic register, immediate, memory and 
clobber constraints.
The code is more or less a direct port from the handling in 
SelectionDAGBuilder.

Before moving on with target specific constraints, I'd like to discuss 
the general strategy for target hooks in GlobalISel.
While most of these hooks on the SelectionDAG side live in the 
TargetLowering class, there is no corresponding GlobalISel subclass of 
the TargetLoweringBase class yet.
Instead, the (one) existing GlobalISel hook currently lives in 
TargetLoweringBase.

For lowering the target specific constraints, we'll have to add a new 
API that creates (G)MIR during IR translation.
Personally I would prefer to have an InlineAsmLowering class, similar to 
the CallLowering class, which implements the generic algorithm and from 
which targets can inherit.
Most of the implementation in [0] could then be moved to that class.

However, this would add yet another class that needs to be wired up in 
the subtarget class. Is this something we would like to avoid?
Is there a better place where target specific GlobalISel hooks should be 
added?

Thanks for your feedback!

Best regards,

Konstantin

[0] https://reviews.llvm.org/D77535



More information about the llvm-dev mailing list