This is an archive of the discontinued LLVM Phabricator instance.

[X86] Support of no_caller_saved_registers attribute (LLVM part)
AbandonedPublic

Authored by aaboud on Jul 6 2016, 7:24 AM.

Details

Summary

This patch implements the LLVM part for no_caller_saved_registers attribute as appear in interrupt and exception handler proposal

Diff Detail

Event Timeline

aaboud updated this revision to Diff 62860.Jul 6 2016, 7:24 AM
aaboud retitled this revision from to [X86] Support of no_caller_saved_registers attribute (LLVM part).
aaboud updated this object.
aaboud added a subscriber: llvm-commits.
aaboud added inline comments.Jul 6 2016, 7:27 AM
test/CodeGen/X86/x86-32-intrcc.ll
60–67

I will commit this change in a separate commit as it is not related to no_caller_saved_register attribute.
But it is related to X86 interrupt handler calling convention.

This test was written incorrect and the below lines were ignored by FileCheck.

test/CodeGen/X86/x86-64-intrcc.ll
60–71

I will commit this change in a separate commit as it is not related to no_caller_saved_register attribute.
But it is related to X86 interrupt handler calling convention.

This test was written incorrect and the below lines were ignored by FileCheck.

qcolombet added inline comments.Jul 22 2016, 4:19 PM
lib/Target/X86/X86ISelLowering.cpp
3374

The right way to do this, IMO, is to add the calling convention in LLVM like all other ones and have clang/the front-end selects the right calling convention when it sees the attribute.
In other words, I don’t think we want to push attribute checking in here.

aaboud added inline comments.Jul 24 2016, 4:46 AM
lib/Target/X86/X86ISelLowering.cpp
3374

Please, correct me if I am mistaken, but calling convention determine not only what the callee and the caller function saved registers are, but also how we move parameters to the called function, right?
The idea behind no_caller_saved_registers attribute, is that it can be combined with any other calling convention, and it only override the callee/caller saved register list, but not the way parameters are passed to the called function.

So, using a calling convention for this attribute will not be right.

H.J., can you confirm this?

hjl.tools added inline comments.Jul 25 2016, 8:12 AM
lib/Target/X86/X86ISelLowering.cpp
3374

That is correct. no_caller_saved_registers attribute
can be used with any calling conventions.

aaboud updated this revision to Diff 66811.Aug 4 2016, 8:48 AM

Updated trunk version to fit the patch in Clang part D22045.

ABataev resigned from this revision.Feb 13 2017, 11:44 AM
aaboud abandoned this revision.Apr 12 2017, 4:41 AM

Changes in this patch are being reviewed in a new patch D31876.

MatzeB added a subscriber: MatzeB.Apr 27 2017, 10:06 AM

If you add new attributes please document them in docs/LangRef.rst.