summaryrefslogtreecommitdiff
path: root/lib/Target/AVR/AVRISelLowering.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/AVR/AVRISelLowering.cpp')
-rw-r--r--lib/Target/AVR/AVRISelLowering.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Target/AVR/AVRISelLowering.cpp b/lib/Target/AVR/AVRISelLowering.cpp
index d9e27e91405c..c1515571aae5 100644
--- a/lib/Target/AVR/AVRISelLowering.cpp
+++ b/lib/Target/AVR/AVRISelLowering.cpp
@@ -345,6 +345,9 @@ SDValue AVRTargetLowering::LowerDivRem(SDValue Op, SelectionDAG &DAG) const {
case MVT::i64:
LC = IsSigned ? RTLIB::SDIVREM_I64 : RTLIB::UDIVREM_I64;
break;
+ case MVT::i128:
+ LC = IsSigned ? RTLIB::SDIVREM_I128 : RTLIB::UDIVREM_I128;
+ break;
}
SDValue InChain = DAG.getEntryNode();
@@ -867,10 +870,12 @@ bool AVRTargetLowering::isOffsetFoldingLegal(
/// For each argument in a function store the number of pieces it is composed
/// of.
-static void parseFunctionArgs(const Function *F, const DataLayout *TD,
+static void parseFunctionArgs(const SmallVectorImpl<ISD::InputArg> &Ins,
SmallVectorImpl<unsigned> &Out) {
- for (Argument const &Arg : F->args()) {
- unsigned Bytes = (TD->getTypeSizeInBits(Arg.getType()) + 7) / 8;
+ for (const ISD::InputArg &Arg : Ins) {
+ if(Arg.PartOffset > 0) continue;
+ unsigned Bytes = ((Arg.ArgVT.getSizeInBits()) + 7) / 8;
+
Out.push_back((Bytes + 1) / 2);
}
}
@@ -938,7 +943,7 @@ static void analyzeStandardArguments(TargetLowering::CallLoweringInfo *CLI,
parseExternFuncCallArgs(*Outs, Args);
} else {
assert(F != nullptr && "function should not be null");
- parseFunctionArgs(F, TD, Args);
+ parseFunctionArgs(*Ins, Args);
}
unsigned RegsLeft = array_lengthof(RegList8), ValNo = 0;