I think this patch is really close, just needs some typo fixes. I'm hesitant to approve since no one else has had a chance to look at it.
Wed, Jan 15
Mon, Jan 13
Fri, Jan 10
Thu, Jan 9
Wed, Jan 8
Dec 17 2019
We added the fatal_error in the previous patch in order to keep the patch as small and focused as possible. For back-end implementation everything should just work: we allocate a frame index for the object on the stack and pass a pointer to the frame-object as the argument. At that point its simply another pointer argument. As Hubert mentions though there is front-end (clang/CodeGen) work that is needed for generating the correct IR for AIX argument passing.
Dec 16 2019
So it doesn't look like we need to add any special handling for struct returns on AIX? I had a quick look and none of the other PPC targets seem to have anything.
Dec 11 2019
Nit: It may be better to rename the test aix-indirect-call.ll to be consistent.
Dec 6 2019
Dec 4 2019
Patch looks good to me.
Nov 26 2019
Fixed testcase typo.
Rebase of latest masters (Nov 26, 2019) and fix testcase register typo.
Moved variable declarations and definition to just before they are first used.
Added zext i1 testcase and check for absence of clear instruction.
Nov 19 2019
Moved assert to earliest position in truncateScalarIntger().
Removed std::max when calculating MinReservedArea.
Used opt -mem2reg to remove allocas resulting in body of callee functions looking cleaner with fewer unnecessary lines.
Nov 14 2019
Made truncateScalarIntegers not a member of PPCISelLowering class.
Removed fatal error for altivec, CC_AIX already errors with vector args.
Removed -mattr=-maltivec on tests where I added it, as we no longer error on those.
Overall, I think this refactor aids in readability and clarity of calling convention code PPCISelLowering.cpp. Even small changes like renaming InFlag to Glue go a long way in helping understanding.
Nov 13 2019
Updates testcases to use all of the parameters in the function definition.
A couple high level comments on the tests.
- I like how you extended the 'LowerCall' tests to test both the caller and callee side, as opposed to adding new tests just for the formal argument lowering.
- There are a lot of tests covering quite a few cases. Its good to have thorough coverage. Having separate test cases for things like 1 float vs 3 floats, and 1 i8, vs 4 sext i8s, vs 4 zext i8s might be a little too verbose though. Having a couple calls that mix various extensions of the i8/i16 types i32 and i64 types should give adequate test coverage. Similarly for the fpr tests, a call which mixes doubles and floats should be adequate. I think the most descriptive test are those that are mixing floating and integer/pointer values. For example calling a function with a signature like: (i64 %a, double %d, i1 zeroext %b, float %f, i16 signext %c) shows how we split the i64 for 32-bit codegen, skip gprs for doubls/floats and map the smaller then register sized types into a gpr all in 1 test.
- Addressed second round of comments.
- Added truncateScalarIntegerArgs function, now we add sext, zext nodes if they are needed and truncate whenever an int size is smaller than the register size.
- use CCinfo to allocate stack.
- consolidated calling convention testcases and removed some non-essential tests
Nov 5 2019
1 .Fixed broken testcases for AIX because of explicit error with altivec, and added reviewer for these.
- Added additional guard to assert if i64 are not split into i32 before register allocation.
- Rebased patch on master.