[PATCH] D100788: [SystemZ] Support i128 inline asm operands

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 19 04:45:33 PDT 2021


uweigand added a comment.

In D100788#2766444 <https://reviews.llvm.org/D100788#2766444>, @jonpa wrote:

>> So we should check the register that was created for the matching index (which is inAsmNodeOperands[CurOp+1] at this point); if it is a virtual register, get the RC from the flags, and if it is a physical register, use the RC this physreg is a member of. Does that make sense?
>
> Yes... I however found that we have to implement getRegClassFor(MVT::Untyped) to make inline assembly phys-regs work in InstrEmitter::EmitCopyFromReg(). If we do this we can use this also in SelectionDAGBuilder instead of the above. This seems to work as long as we only have one untyped regclass even though it is slightly confusing to not use the regclass returned by getRegForInlineAsmConstraint().

Can you elaborate?   I thought `InstrEmitter::EmitCopyFromReg()` was supposed to also work with types that are not legal.    It uses

  SrcRC = TRI->getMinimalPhysRegClass(SrcReg, VT);

to get the RC for use with a physreg ...

I don't really like implementing `getRegClassFor(MVT::Untyped)` ... that seems a bit underspecified.

As I said, I still think the best option would be to remove the getRegClassFor call in the tied register case in visitInlineAsm, and instead retrieve the RC either from the OpFlags (if virtual reg) or via getMinimalPhysRegClass (if phys reg).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100788/new/

https://reviews.llvm.org/D100788



More information about the llvm-commits mailing list