summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/Mips16HardFloat.cpp
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-08-01 02:26:31 +0000
committerReed Kotler <rkotler@mips.com>2013-08-01 02:26:31 +0000
commitf71698747e07145657bd8595162439da40ebd749 (patch)
tree572b9d83c76dda05a8bc25356b49ff36402bc46d /lib/Target/Mips/Mips16HardFloat.cpp
parent9d45f914f080e591e12787ac1c12b3819870076a (diff)
downloadllvm-f71698747e07145657bd8595162439da40ebd749.tar.gz
llvm-f71698747e07145657bd8595162439da40ebd749.tar.bz2
llvm-f71698747e07145657bd8595162439da40ebd749.tar.xz
Fix some misc. issues with Mips16 fp stubs.
1) They should never be inlined. 2) A naming inconsistency with gcc mips16 3) Stubs should not have the global attribute git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187555 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/Mips16HardFloat.cpp')
-rw-r--r--lib/Target/Mips/Mips16HardFloat.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Target/Mips/Mips16HardFloat.cpp b/lib/Target/Mips/Mips16HardFloat.cpp
index 45dd5d7957..7e456aa6d1 100644
--- a/lib/Target/Mips/Mips16HardFloat.cpp
+++ b/lib/Target/Mips/Mips16HardFloat.cpp
@@ -247,7 +247,7 @@ static void assureFPCallStub(Function &F, Module *M,
bool LE = Subtarget.isLittle();
std::string Name = F.getName();
std::string SectionName = ".mips16.call.fp." + Name;
- std::string StubName = "__call_stub_" + Name;
+ std::string StubName = "__call_stub_fp_" + Name;
//
// see if we already have the stub
//
@@ -257,11 +257,13 @@ static void assureFPCallStub(Function &F, Module *M,
Function::InternalLinkage, StubName, M);
FStub->addFnAttr("mips16_fp_stub");
FStub->addFnAttr(llvm::Attribute::Naked);
+ FStub->addFnAttr(llvm::Attribute::NoInline);
FStub->addFnAttr(llvm::Attribute::NoUnwind);
FStub->addFnAttr("nomips16");
FStub->setSection(SectionName);
BasicBlock *BB = BasicBlock::Create(Context, "entry", FStub);
InlineAsmHelper IAH(Context, BB);
+ IAH.Out(".set reorder");
FPReturnVariant RV = whichFPReturnVariant(FStub->getReturnType());
FPParamVariant PV = whichFPParamVariantNeeded(F);
swapFPIntParams(PV, M, IAH, LE, true);
@@ -361,6 +363,8 @@ static bool fixupFPReturnAndCall
"__Mips16RetHelper");
A = A.addAttribute(C, AttributeSet::FunctionIndex,
Attribute::ReadNone);
+ A = A.addAttribute(C, AttributeSet::FunctionIndex,
+ Attribute::NoInline);
Value *F = (M->getOrInsertFunction(Name, A, MyVoid, T, NULL));
CallInst::Create(F, Params, "", &Inst );
} else if (const CallInst *CI = dyn_cast<CallInst>(I)) {
@@ -389,10 +393,11 @@ static void createFPFnStub(Function *F, Module *M, FPParamVariant PV,
std::string LocalName = "__fn_local_" + Name;
Function *FStub = Function::Create
(F->getFunctionType(),
- Function::ExternalLinkage, StubName, M);
+ Function::InternalLinkage, StubName, M);
FStub->addFnAttr("mips16_fp_stub");
FStub->addFnAttr(llvm::Attribute::Naked);
FStub->addFnAttr(llvm::Attribute::NoUnwind);
+ FStub->addFnAttr(llvm::Attribute::NoInline);
FStub->addFnAttr("nomips16");
FStub->setSection(SectionName);
BasicBlock *BB = BasicBlock::Create(Context, "entry", FStub);