This is an archive of the discontinued LLVM Phabricator instance.

[PPCAsmPrinter] support 'L' output template for memory operands
ClosedPublic

Authored by nickdesaulniers on Jun 12 2020, 2:30 PM.

Details

Summary

L is meant to support the second word used by 32b calling conventions for 64b arguments.

This is required for build 32b PowerPC Linux kernels after upstream
commit 334710b1496a ("powerpc/uaccess: Implement unsafe_put_user() using 'asm goto'")

Thanks for the report from @nathanchance, and reference to GCC's
implementation from @segher.

Fixes: pr/46186
Fixes: https://github.com/ClangBuiltLinux/linux/issues/1044

Diff Detail

Event Timeline

Looking at the GCC implementation, which refers to "preinc/predec/premodify" modes and small data operands, I can't help but think I may need to do something differently based on some method call against PPCSubtarget.

Comment what it is?

nickdesaulniers edited the summary of this revision. (Show Details)Jun 12 2020, 4:20 PM
nickdesaulniers edited the summary of this revision. (Show Details)Jun 12 2020, 4:26 PM
  • add source comment
nickdesaulniers edited the summary of this revision. (Show Details)Jun 12 2020, 4:30 PM
MaskRay added inline comments.
llvm/test/CodeGen/PowerPC/inlineasm-output-template.ll
31

ppc64 has a different offset. Add a ppc64 test

nickdesaulniers marked an inline comment as done.Jun 15 2020, 12:35 PM
MaskRay accepted this revision.Jun 15 2020, 12:51 PM

Thanks!

llvm/test/CodeGen/PowerPC/inlineasm-output-template.ll
2

You can just write ppc64

This revision is now accepted and ready to land.Jun 15 2020, 12:51 PM
  • drop unused part of triple, as per @MaskRay
nickdesaulniers marked an inline comment as done.Jun 15 2020, 2:10 PM
This revision was automatically updated to reflect the committed changes.

Hi, you can drop Reviewers: Subscribers: Tags: and the text Summary: with the following script

arcfilter () {
        arc amend
        git log -1 --pretty=%B | awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:$/ {sub(/^Summary: /,"");print}' | git commit --amend --date=now -F -
}

Reviewed By: is considered important by some people. Please keep the tag. (I have updated my script to use --date=now (setting author date to committer date))

https://reviews.llvm.org/D80978 contains a git pre-push hook to automate this.

nickdesaulniers added a comment.EditedJun 15 2020, 4:10 PM

Hi, you can drop Reviewers: Subscribers: Tags: and the text Summary: with the following script

arcfilter () {
        arc amend
        git log -1 --pretty=%B | awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:$/ {sub(/^Summary: /,"");print}' | git commit --amend --date=now -F -
}

Reviewed By: is considered important by some people. Please keep the tag. (I have updated my script to use --date=now (setting author date to committer date))

I've just been using arc patch to patch in the patch w/ preformatted commit, then merging that. If I don't need all that, I'll just avoid arc patch in the first place.

https://reviews.llvm.org/D80978 contains a git pre-push hook to automate this.