This is an archive of the discontinued LLVM Phabricator instance.

[AIX] Implement call lowering with parameters could pass onto GPRs
ClosedPublic

Authored by jasonliu on Jun 3 2019, 2:06 PM.

Details

Summary

This patch implements SDAG call lowering on AIX for functions which only have parameters that could fit into GPRs.

Diff Detail

Repository
rL LLVM

Event Timeline

jasonliu created this revision.Jun 3 2019, 2:06 PM
syzaara added inline comments.Jun 4 2019, 7:15 AM
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
6624 ↗(On Diff #202796)

nit: extra comma at end of list

jasonliu updated this revision to Diff 202954.Jun 4 2019, 9:05 AM

Address comments.

jasonliu marked 2 inline comments as done.Jun 4 2019, 9:06 AM
jasonliu added inline comments.
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
6624 ↗(On Diff #202796)

Thanks. Addressed.

syzaara accepted this revision.Jun 4 2019, 10:06 AM

LGTM

This revision is now accepted and ready to land.Jun 4 2019, 10:06 AM
hubert.reinterpretcast requested changes to this revision.Jun 4 2019, 10:16 AM
hubert.reinterpretcast added inline comments.
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
6631 ↗(On Diff #202954)

This looks fragile.

This revision now requires changes to proceed.Jun 4 2019, 10:16 AM
jasonliu updated this revision to Diff 202983.Jun 4 2019, 10:52 AM
jasonliu marked an inline comment as done.
jasonliu marked an inline comment as done.
jasonliu added inline comments.
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
6631 ↗(On Diff #202954)

Got it. How about now?

llvm/lib/Target/PowerPC/PPCISelLowering.cpp
6651 ↗(On Diff #202983)

Please fix the indentation.

6666 ↗(On Diff #202983)

Add "the" before "stack".

jasonliu updated this revision to Diff 203136.Jun 5 2019, 6:55 AM

Fix indentation and comments.

jasonliu marked 2 inline comments as done.Jun 5 2019, 6:56 AM
llvm/test/CodeGen/PowerPC/aix_gpr_param.ll
36 ↗(On Diff #202983)

Please test with some use of zeroext and some values where it would matter.

call void @test_chars(i8 signext 97, i8 zeroext -31, i8 zeroext 97, i8 signext -31)
72 ↗(On Diff #202983)

Similarly (although the front-end does not seem to produce this for AIX yet),

call void @test_ints(i32 signext 1, i32 zeroext 1, i32 zeroext 2147483648, i32 signext -2147483648, i32 signext 1, i32 signext 1, i32 signext 1, i32 signext 1)
114 ↗(On Diff #202983)
declare void @test_chars(i8 signext, i8 zeroext, i8 zeroext, i8 signext)
118 ↗(On Diff #202983)
declare void @test_ints(i32 signext, i32 zeroext, i32 zeroext, i32 signext, i32 signext, i32 signext, i32 signext, i32 signext)

Have a separate function if you are concerned that this is more 64-bit specific than not.

jasonliu updated this revision to Diff 203224.Jun 5 2019, 12:33 PM

Update the test case to address comments.

jasonliu marked 4 inline comments as done.Jun 5 2019, 12:34 PM
This revision is now accepted and ready to land.Jun 5 2019, 6:04 PM
This revision was automatically updated to reflect the committed changes.