[llvm] a2d7ace - GlobalISel: Surface offsets parameter from ComputeValueVTs
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 15 16:11:56 PDT 2021
Author: Matt Arsenault
Date: 2021-07-15T19:11:40-04:00
New Revision: a2d7ace3e3e9804c5b616be402f37b21549db80e
URL: https://github.com/llvm/llvm-project/commit/a2d7ace3e3e9804c5b616be402f37b21549db80e
DIFF: https://github.com/llvm/llvm-project/commit/a2d7ace3e3e9804c5b616be402f37b21549db80e.diff
LOG: GlobalISel: Surface offsets parameter from ComputeValueVTs
Added:
Modified:
llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
index 3bee9734d8a1..0e6392084a50 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
@@ -355,9 +355,13 @@ class CallLowering {
/// Break \p OrigArgInfo into one or more pieces the calling convention can
/// process, returned in \p SplitArgs. For example, this should break structs
/// down into individual fields.
+ ///
+ /// If \p Offsets is non-null, it points to a vector to be filled in
+ /// with the in-memory offsets of each of the individual values.
void splitToValueTypes(const ArgInfo &OrigArgInfo,
SmallVectorImpl<ArgInfo> &SplitArgs,
- const DataLayout &DL, CallingConv::ID CallConv) const;
+ const DataLayout &DL, CallingConv::ID CallConv,
+ SmallVectorImpl<uint64_t> *Offsets = nullptr) const;
/// Generate instructions for unpacking \p SrcReg into the \p DstRegs
/// corresponding to the aggregate type \p PackedTy.
diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
index 282414170a8d..a1658969ea22 100644
--- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
@@ -207,12 +207,12 @@ CallLowering::setArgFlags<CallBase>(CallLowering::ArgInfo &Arg, unsigned OpIdx,
void CallLowering::splitToValueTypes(const ArgInfo &OrigArg,
SmallVectorImpl<ArgInfo> &SplitArgs,
const DataLayout &DL,
- CallingConv::ID CallConv) const {
+ CallingConv::ID CallConv,
+ SmallVectorImpl<uint64_t> *Offsets) const {
LLVMContext &Ctx = OrigArg.Ty->getContext();
SmallVector<EVT, 4> SplitVTs;
- SmallVector<uint64_t, 4> Offsets;
- ComputeValueVTs(*TLI, DL, OrigArg.Ty, SplitVTs, &Offsets, 0);
+ ComputeValueVTs(*TLI, DL, OrigArg.Ty, SplitVTs, Offsets, 0);
if (SplitVTs.size() == 0)
return;
More information about the llvm-commits
mailing list