
Replace Mips custom logic for retaining information about original types in calling convention lowering by directly querying the OrigTy that is now available. There is one change in behavior here: If the return type is a struct containing fp128 plus additional members, the result is now different, as we no longer special case to a single fp128 member. I believe this is fine, because this is a fake ABI anyway: Such cases should actually use sret, and as such are a frontend responsibility, and Clang will indeed emit these as sret, not as a return value struct. So this only impacts manually written IR tests.
45 lines
1.5 KiB
C++
45 lines
1.5 KiB
C++
//===---- MipsCCState.h - CCState with Mips specific extensions -----------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef MIPSCCSTATE_H
|
|
#define MIPSCCSTATE_H
|
|
|
|
#include "MipsISelLowering.h"
|
|
#include "llvm/ADT/SmallVector.h"
|
|
#include "llvm/CodeGen/CallingConvLower.h"
|
|
|
|
namespace llvm {
|
|
class SDNode;
|
|
class MipsSubtarget;
|
|
|
|
class MipsCCState : public CCState {
|
|
public:
|
|
enum SpecialCallingConvType { Mips16RetHelperConv, NoSpecialCallingConv };
|
|
|
|
/// Determine the SpecialCallingConvType for the given callee
|
|
static SpecialCallingConvType
|
|
getSpecialCallingConvForCallee(const SDNode *Callee,
|
|
const MipsSubtarget &Subtarget);
|
|
|
|
private:
|
|
// Used to handle MIPS16-specific calling convention tweaks.
|
|
// FIXME: This should probably be a fully fledged calling convention.
|
|
SpecialCallingConvType SpecialCallingConv;
|
|
|
|
public:
|
|
MipsCCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF,
|
|
SmallVectorImpl<CCValAssign> &locs, LLVMContext &C,
|
|
SpecialCallingConvType SpecialCC = NoSpecialCallingConv)
|
|
: CCState(CC, isVarArg, MF, locs, C), SpecialCallingConv(SpecialCC) {}
|
|
|
|
SpecialCallingConvType getSpecialCallingConv() { return SpecialCallingConv; }
|
|
};
|
|
}
|
|
|
|
#endif
|