This is an archive of the discontinued LLVM Phabricator instance.

[mips] Defer va_arg expansion to the backend.
ClosedPublic

Authored by dsanders on Jul 31 2014, 9:29 AM.

Details

Summary

This patch causes clang to emit va_arg instructions to the backend instead of
expanding them into an implementation itself. The backend already implements
va_arg since this is necessary for NaCl so this patch is removing redundant
code.

Together with the llvm patch (D4556) that accounts for the effect of endianness
on the expansion of va_arg, this fixes PR19612.

Depends on D4556

Diff Detail

Event Timeline

dsanders updated this revision to Diff 12067.Jul 31 2014, 9:29 AM
dsanders updated this revision to Diff 12068.
dsanders retitled this revision from to [mips] Defer va_arg expansion to the backend..
dsanders updated this object.
dsanders edited the test plan for this revision. (Show Details)
dsanders added a reviewer: sstankovic.
dsanders added a subscriber: Unknown Object (MLST).

Remove swap files that were accidentally added in the 'arc diff' command.

dsanders removed a subscriber: Unknown Object (MLST).Jul 31 2014, 9:37 AM
dsanders added a subscriber: Unknown Object (MLST).

Added cfe-commits instead of llvm-commits.

Sorry, this should have been sent to cfe-commits. I've corrected this.

rnk added a subscriber: rnk.Jul 31 2014, 10:44 AM

Looks good to me, as a drive by.

test/CodeGen/mips-vaarg.c
7

Seems light. How about doing CHECK-LABEL on 'define i32 @foo' and looking for call @llvm.va_start and end?

dsanders updated this revision to Diff 12076.Jul 31 2014, 11:38 AM

Expanded on the test case as Reid suggested and accounted for different
alignment requirements of the pointer between the N32 and N64 ABI's.

Thanks. I'll commit after I've committed D4556 since I've only tested the two patches together.

dsanders accepted this revision.Aug 1 2014, 3:37 AM
dsanders added a reviewer: dsanders.
This revision is now accepted and ready to land.Aug 1 2014, 3:37 AM
dsanders closed this revision.Aug 1 2014, 3:38 AM