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/ARMISelLowering.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/ARMISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 18bb9bf3ecc..ee619353897 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -3898,6 +3898,12 @@ SDValue ARMTargetLowering::LowerFormalArguments( // Transform the arguments in physical registers into virtual ones. unsigned Reg = MF.addLiveIn(VA.getLocReg(), RC); ArgValue = DAG.getCopyFromReg(Chain, dl, Reg, RegVT); + + // If this value is passed in r0 and has the returned attribute (e.g. + // C++ 'structors), record this fact for later use. + if (VA.getLocReg() == ARM::R0 && Ins[VA.getValNo()].Flags.isReturned()) { + AFI->setPreservesR0(); + } } // If this is an 8 or 16-bit value, it is really passed promoted |