[PATCH] D122220: [InlineAsm] Add support for address operands ("p").

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 25 09:40:35 PDT 2022


jonpa updated this revision to Diff 418254.
jonpa added a comment.
Herald added a subscriber: jdoerfert.

Thanks for review!

In D122220#3407060 <https://reviews.llvm.org/D122220#3407060>, @xiangzhangllvm wrote:

> I didn't see the 'p' defined in
> Machine-Constraints <https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints> on x86
>
> A question I care about is:
> How we (customers) can quickly refer to the meaning of new added constrain 'p'.

That is a good point, and I think we need to add a description in the LLVM llanguage manual for 'p' under the section "Supported Constraint Code List". As 'p' is a shared code over targets I think it should be listed in the common section (as it is in gcc documentation link). I updated the patch with this addition - what do you think?

In D122220#3407081 <https://reviews.llvm.org/D122220#3407081>, @xiangzhangllvm wrote:

>> X86TargetInfo::validateAsmConstraint(): I don't know why not 'm' is accepted here..?
>
> The answer can be find in function TargetInfo::validateInputConstraint.
> Because not all constrains will be checked by validateAsmConstraint.

Ah, I see: first validateInputConstraint() is called and then only if needed is the target validateAsmConstraint() used. I removed the 'p' handling I had added in SystemZ::validateAsmConstraint() which is actually then not needed/used. I am a little surprised now that this works, as validateInputConstraint() does not call 'Info.setAllowsRegister()' for 'p', which is needed for the SystemZ specific address constraints (see https://reviews.llvm.org/D110267).


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

https://reviews.llvm.org/D122220

Files:
  clang/lib/Basic/Targets/SystemZ.h
  clang/lib/Basic/Targets/X86.cpp
  clang/test/CodeGen/SystemZ/systemz-inline-asm-03.c
  clang/test/CodeGen/asm.c
  llvm/docs/LangRef.rst
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/include/llvm/IR/InlineAsm.h
  llvm/lib/CodeGen/CodeGenPrepare.cpp
  llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp
  llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
  llvm/test/CodeGen/SystemZ/inline-asm-addr.ll
  llvm/test/CodeGen/X86/inline-asm-p-constraint.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122220.418254.patch
Type: text/x-patch
Size: 14632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220325/529945ee/attachment.bin>


More information about the llvm-commits mailing list