[llvm] a4f8551 - [Hexagon] Remove custom vararg tracking (NFCI) (#154089)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 19 00:27:14 PDT 2025
Author: Nikita Popov
Date: 2025-08-19T09:27:11+02:00
New Revision: a4f85515c20566a3c059aacd1ee3554b598f33f0
URL: https://github.com/llvm/llvm-project/commit/a4f85515c20566a3c059aacd1ee3554b598f33f0
DIFF: https://github.com/llvm/llvm-project/commit/a4f85515c20566a3c059aacd1ee3554b598f33f0.diff
LOG: [Hexagon] Remove custom vararg tracking (NFCI) (#154089)
This information is now directly available, use the generic
CCIfArgVarArg.
Added:
Modified:
llvm/lib/Target/Hexagon/HexagonCallingConv.td
llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/Hexagon/HexagonCallingConv.td b/llvm/lib/Target/Hexagon/HexagonCallingConv.td
index e0302b85fa948..fd6d873dd4188 100644
--- a/llvm/lib/Target/Hexagon/HexagonCallingConv.td
+++ b/llvm/lib/Target/Hexagon/HexagonCallingConv.td
@@ -6,11 +6,6 @@
//
//===----------------------------------------------------------------------===//
-class CCIfArgIsVarArg<CCAction A>
- : CCIf<"State.isVarArg() && "
- "ValNo >= static_cast<HexagonCCState&>(State)"
- ".getNumNamedVarArgParams()", A>;
-
def CC_HexagonStack: CallingConv<[
CCIfType<[i32,v2i16,v4i8],
CCAssignToStack<4,4>>,
@@ -28,7 +23,7 @@ def CC_Hexagon_Legacy: CallingConv<[
CCIfByVal<
CCPassByVal<8,8>>,
- CCIfArgIsVarArg<
+ CCIfArgVarArg<
CCDelegateTo<CC_HexagonStack>>,
// Pass split values in pairs, allocate odd register if necessary.
@@ -58,7 +53,7 @@ def CC_Hexagon: CallingConv<[
CCIfByVal<
CCPassByVal<8,1>>,
- CCIfArgIsVarArg<
+ CCIfArgVarArg<
CCDelegateTo<CC_HexagonStack>>,
// Pass split values in pairs, allocate odd register if necessary.
diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
index facea646d4b68..c54b67ccd8843 100644
--- a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
@@ -116,23 +116,6 @@ static cl::opt<bool>
cl::desc("Disable minimum alignment of 1 for "
"arguments passed by value on stack"));
-namespace {
-
- class HexagonCCState : public CCState {
- unsigned NumNamedVarArgParams = 0;
-
- public:
- HexagonCCState(CallingConv::ID CC, bool IsVarArg, MachineFunction &MF,
- SmallVectorImpl<CCValAssign> &locs, LLVMContext &C,
- unsigned NumNamedArgs)
- : CCState(CC, IsVarArg, MF, locs, C),
- NumNamedVarArgParams(NumNamedArgs) {}
- unsigned getNumNamedVarArgParams() const { return NumNamedVarArgParams; }
- };
-
-} // end anonymous namespace
-
-
// Implement calling convention for Hexagon.
static bool CC_SkipOdd(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
@@ -497,7 +480,6 @@ HexagonTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
MachineFrameInfo &MFI = MF.getFrameInfo();
auto PtrVT = getPointerTy(MF.getDataLayout());
- unsigned NumParams = CLI.CB ? CLI.CB->getFunctionType()->getNumParams() : 0;
if (GlobalAddressSDNode *GAN = dyn_cast<GlobalAddressSDNode>(Callee))
Callee = DAG.getTargetGlobalAddress(GAN->getGlobal(), dl, MVT::i32);
@@ -506,8 +488,7 @@ HexagonTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
// Analyze operands of the call, assigning locations to each operand.
SmallVector<CCValAssign, 16> ArgLocs;
- HexagonCCState CCInfo(CallConv, TreatAsVarArg, MF, ArgLocs, *DAG.getContext(),
- NumParams);
+ CCState CCInfo(CallConv, TreatAsVarArg, MF, ArgLocs, *DAG.getContext());
if (Subtarget.useHVXOps())
CCInfo.AnalyzeCallOperands(Outs, CC_Hexagon_HVX);
@@ -880,9 +861,7 @@ SDValue HexagonTargetLowering::LowerFormalArguments(
// Assign locations to all of the incoming arguments.
SmallVector<CCValAssign, 16> ArgLocs;
- HexagonCCState CCInfo(CallConv, TreatAsVarArg, MF, ArgLocs,
- *DAG.getContext(),
- MF.getFunction().getFunctionType()->getNumParams());
+ CCState CCInfo(CallConv, TreatAsVarArg, MF, ArgLocs, *DAG.getContext());
if (Subtarget.useHVXOps())
CCInfo.AnalyzeFormalArguments(Ins, CC_Hexagon_HVX);
More information about the llvm-commits
mailing list