mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +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,24 +1238,29 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
|
||||
unsigned NumValues = ValueVTs.size();
|
||||
if (NumValues) {
|
||||
SDValue RetOp = getValue(I.getOperand(0));
|
||||
for (unsigned j = 0, f = NumValues; j != f; ++j) {
|
||||
|
||||
const Function *F = I.getParent()->getParent();
|
||||
|
||||
ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
|
||||
if (F->getAttributes().hasAttribute(AttributeSet::ReturnIndex,
|
||||
Attribute::SExt))
|
||||
ExtendKind = ISD::SIGN_EXTEND;
|
||||
else if (F->getAttributes().hasAttribute(AttributeSet::ReturnIndex,
|
||||
Attribute::ZExt))
|
||||
ExtendKind = ISD::ZERO_EXTEND;
|
||||
|
||||
LLVMContext &Context = F->getContext();
|
||||
bool RetInReg = F->getAttributes().hasAttribute(AttributeSet::ReturnIndex,
|
||||
Attribute::InReg);
|
||||
|
||||
for (unsigned j = 0; j != NumValues; ++j) {
|
||||
EVT VT = ValueVTs[j];
|
||||
|
||||
ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
|
||||
|
||||
const Function *F = I.getParent()->getParent();
|
||||
if (F->getAttributes().hasAttribute(AttributeSet::ReturnIndex,
|
||||
Attribute::SExt))
|
||||
ExtendKind = ISD::SIGN_EXTEND;
|
||||
else if (F->getAttributes().hasAttribute(AttributeSet::ReturnIndex,
|
||||
Attribute::ZExt))
|
||||
ExtendKind = ISD::ZERO_EXTEND;
|
||||
|
||||
if (ExtendKind != ISD::ANY_EXTEND && VT.isInteger())
|
||||
VT = TLI.getTypeForExtArgOrReturn(*DAG.getContext(), VT, ExtendKind);
|
||||
VT = TLI.getTypeForExtArgOrReturn(Context, VT, ExtendKind);
|
||||
|
||||
unsigned NumParts = TLI.getNumRegisters(*DAG.getContext(), VT);
|
||||
MVT PartVT = TLI.getRegisterType(*DAG.getContext(), VT);
|
||||
unsigned NumParts = TLI.getNumRegisters(Context, VT);
|
||||
MVT PartVT = TLI.getRegisterType(Context, VT);
|
||||
SmallVector<SDValue, 4> Parts(NumParts);
|
||||
getCopyToParts(DAG, getCurSDLoc(),
|
||||
SDValue(RetOp.getNode(), RetOp.getResNo() + j),
|
||||
@ -1263,8 +1268,7 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
|
||||
|
||||
// 'inreg' on function refers to return value
|
||||
ISD::ArgFlagsTy Flags = ISD::ArgFlagsTy();
|
||||
if (F->getAttributes().hasAttribute(AttributeSet::ReturnIndex,
|
||||
Attribute::InReg))
|
||||
if (RetInReg)
|
||||
Flags.setInReg();
|
||||
|
||||
// Propagate extension type if any
|
||||
|
Loading…
x
Reference in New Issue
Block a user