mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +00:00
SelectionDAGBuilder: move constant initialization out of loop
No semantic change intended. Reviewers: resistor Differential Revision: http://reviews.llvm.org/D6834 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225278 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1f996fa36b
commit
35300ff218
@ -1238,12 +1238,10 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
|
|||||||
unsigned NumValues = ValueVTs.size();
|
unsigned NumValues = ValueVTs.size();
|
||||||
if (NumValues) {
|
if (NumValues) {
|
||||||
SDValue RetOp = getValue(I.getOperand(0));
|
SDValue RetOp = getValue(I.getOperand(0));
|
||||||
for (unsigned j = 0, f = NumValues; j != f; ++j) {
|
|
||||||
EVT VT = ValueVTs[j];
|
|
||||||
|
|
||||||
ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
|
|
||||||
|
|
||||||
const Function *F = I.getParent()->getParent();
|
const Function *F = I.getParent()->getParent();
|
||||||
|
|
||||||
|
ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
|
||||||
if (F->getAttributes().hasAttribute(AttributeSet::ReturnIndex,
|
if (F->getAttributes().hasAttribute(AttributeSet::ReturnIndex,
|
||||||
Attribute::SExt))
|
Attribute::SExt))
|
||||||
ExtendKind = ISD::SIGN_EXTEND;
|
ExtendKind = ISD::SIGN_EXTEND;
|
||||||
@ -1251,11 +1249,18 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
|
|||||||
Attribute::ZExt))
|
Attribute::ZExt))
|
||||||
ExtendKind = ISD::ZERO_EXTEND;
|
ExtendKind = ISD::ZERO_EXTEND;
|
||||||
|
|
||||||
if (ExtendKind != ISD::ANY_EXTEND && VT.isInteger())
|
LLVMContext &Context = F->getContext();
|
||||||
VT = TLI.getTypeForExtArgOrReturn(*DAG.getContext(), VT, ExtendKind);
|
bool RetInReg = F->getAttributes().hasAttribute(AttributeSet::ReturnIndex,
|
||||||
|
Attribute::InReg);
|
||||||
|
|
||||||
unsigned NumParts = TLI.getNumRegisters(*DAG.getContext(), VT);
|
for (unsigned j = 0; j != NumValues; ++j) {
|
||||||
MVT PartVT = TLI.getRegisterType(*DAG.getContext(), VT);
|
EVT VT = ValueVTs[j];
|
||||||
|
|
||||||
|
if (ExtendKind != ISD::ANY_EXTEND && VT.isInteger())
|
||||||
|
VT = TLI.getTypeForExtArgOrReturn(Context, VT, ExtendKind);
|
||||||
|
|
||||||
|
unsigned NumParts = TLI.getNumRegisters(Context, VT);
|
||||||
|
MVT PartVT = TLI.getRegisterType(Context, VT);
|
||||||
SmallVector<SDValue, 4> Parts(NumParts);
|
SmallVector<SDValue, 4> Parts(NumParts);
|
||||||
getCopyToParts(DAG, getCurSDLoc(),
|
getCopyToParts(DAG, getCurSDLoc(),
|
||||||
SDValue(RetOp.getNode(), RetOp.getResNo() + j),
|
SDValue(RetOp.getNode(), RetOp.getResNo() + j),
|
||||||
@ -1263,8 +1268,7 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
|
|||||||
|
|
||||||
// 'inreg' on function refers to return value
|
// 'inreg' on function refers to return value
|
||||||
ISD::ArgFlagsTy Flags = ISD::ArgFlagsTy();
|
ISD::ArgFlagsTy Flags = ISD::ArgFlagsTy();
|
||||||
if (F->getAttributes().hasAttribute(AttributeSet::ReturnIndex,
|
if (RetInReg)
|
||||||
Attribute::InReg))
|
|
||||||
Flags.setInReg();
|
Flags.setInReg();
|
||||||
|
|
||||||
// Propagate extension type if any
|
// Propagate extension type if any
|
||||||
|
Loading…
x
Reference in New Issue
Block a user