diff options
| author | Reed Kotler <rkotler@mips.com> | 2013-08-01 02:26:31 +0000 |
|---|---|---|
| committer | Reed Kotler <rkotler@mips.com> | 2013-08-01 02:26:31 +0000 |
| commit | 302ae6b002522f07482697361af30890ee0af31e (patch) | |
| tree | 6f1459aef0b3db4270ac6147b4339052cb82692d /llvm/lib | |
| parent | a8d49794e48aaea2c3ffb9d8105538ec2fa48cd0 (diff) | |
| download | bcm5719-llvm-302ae6b002522f07482697361af30890ee0af31e.tar.gz bcm5719-llvm-302ae6b002522f07482697361af30890ee0af31e.zip | |
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
llvm-svn: 187555
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/Mips/Mips16HardFloat.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/Mips/Mips16HardFloat.cpp b/llvm/lib/Target/Mips/Mips16HardFloat.cpp index 45dd5d7957c..7e456aa6d1e 100644 --- a/llvm/lib/Target/Mips/Mips16HardFloat.cpp +++ b/llvm/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); |

