summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AVR/AVRISelLowering.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Target/AVR/AVRISelLowering.cpp b/llvm/lib/Target/AVR/AVRISelLowering.cpp
index d9e27e91405..7ac8a136e6b 100644
--- a/llvm/lib/Target/AVR/AVRISelLowering.cpp
+++ b/llvm/lib/Target/AVR/AVRISelLowering.cpp
@@ -867,10 +867,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 +940,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;
OpenPOWER on IntegriCloud