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

Xiang Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 27 18:04:41 PDT 2022


xiangzhangllvm added a comment.

In D122220#3408331 <https://reviews.llvm.org/D122220#3408331>, @jonpa wrote:

> 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).

I agree with you, some constraint codes are typically supported by all targets.


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

https://reviews.llvm.org/D122220



More information about the llvm-commits mailing list