diff options
author | Oliver Stannard <oliver.stannard@linaro.org> | 2019-07-22 08:44:36 +0000 |
---|---|---|
committer | Oliver Stannard <oliver.stannard@linaro.org> | 2019-07-22 08:44:36 +0000 |
commit | 6771a89fa01ffb1ea8702d7b07e259750ae62f1c (patch) | |
tree | 7ceb6534c6439741779f2c018a188d97bd9067eb /llvm/lib/Target/ARM/ARMFrameLowering.cpp | |
parent | 6522a7df544efe391519ffd35651a80d6a2186ae (diff) | |
download | bcm5719-llvm-6771a89fa01ffb1ea8702d7b07e259750ae62f1c.tar.gz bcm5719-llvm-6771a89fa01ffb1ea8702d7b07e259750ae62f1c.zip |
[IPRA][ARM] Make use of the "returned" parameter attribute
ARM has code to recognise uses of the "returned" function parameter
attribute which guarantee that the value passed to the function in r0
will be returned in r0 unmodified. IPRA replaces the regmask on call
instructions, so needs to be told about this to avoid reverting the
optimisation.
Differential revision: https://reviews.llvm.org/D64986
llvm-svn: 366669
Diffstat (limited to 'llvm/lib/Target/ARM/ARMFrameLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMFrameLowering.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp index bedb779bcba..7ae0c6ab3cf 100644 --- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp +++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp @@ -2097,6 +2097,12 @@ void ARMFrameLowering::determineCalleeSaves(MachineFunction &MF, AFI->setLRIsSpilledForFarJump(true); } AFI->setLRIsSpilled(SavedRegs.test(ARM::LR)); + + // If we have the "returned" parameter attribute which guarantees that we + // return the value which was passed in r0 unmodified (e.g. C++ 'structors), + // record that fact for IPRA. + if (AFI->getPreservesR0()) + SavedRegs.set(ARM::R0); } MachineBasicBlock::iterator ARMFrameLowering::eliminateCallFramePseudoInstr( |