This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix the none tail call in scalar MASS conversion
ClosedPublic

Authored by masoud.ataei on Mar 4 2022, 11:44 AM.

Details

Reviewers
nemanjai
bmahjour
shchenz
efriedma
jsji
Whitney
Group Reviewers
Restricted Project
Summary

This patch is proposing a fix for patch https://reviews.llvm.org/D101759
on none tail call math function conversion to MASS call.

Diff Detail

Event Timeline

masoud.ataei created this revision.Mar 4 2022, 11:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2022, 11:44 AM
masoud.ataei requested review of this revision.Mar 4 2022, 11:44 AM
jsji added a reviewer: Restricted Project.Mar 7 2022, 11:23 AM
nemanjai accepted this revision.Mar 7 2022, 1:20 PM

LGTM other than the test cases that need to be improved.

llvm/test/CodeGen/PowerPC/lower-intrinsics-afn-mass_notail.ll
6

This check is not adequate. You have added code to ensure that the function isn't tail called when it isn't in a tail call position, yet your test doesn't check anything along those lines.
It is probably best to simply use update_llc_test_checks.py to produce the checks.

This revision is now accepted and ready to land.Mar 7 2022, 1:20 PM
jsji added inline comments.Mar 7 2022, 6:54 PM
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
17760

What is the reason that we don't want to use TLI.makeLibCall here?

masoud.ataei marked 2 inline comments as done.Mar 8 2022, 7:45 AM
masoud.ataei added inline comments.
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
17760

At first, I thought this function will be way simpler than TLI.makeLibCall but now that they are too similar, I will try to call makeLibCall function. There are still some implementation details that needs to be take care of, like RTLIB::Libcall and CallOptions.

Since I am fixing a bug here, I will commit this patch as is and will work on creating a new patch to use TLI.makeLibCall.

jsji added inline comments.Mar 8 2022, 8:09 AM
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
17760

Sounds good. Thanks!

masoud.ataei closed this revision.Mar 8 2022, 9:16 AM
masoud.ataei marked an inline comment as done.