diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-01 21:57:11 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-01 21:57:11 +0000 |
commit | 41410cc812a23362de9815e4c25d6287a74e0973 (patch) | |
tree | 301567d55e5d90dd918db8b5e67fd7245871fc1a /llvm/lib/Target/ARM/ARMISelLowering.cpp | |
parent | 00880511b15621a95a506c80af325cf04da57d76 (diff) | |
download | bcm5719-llvm-41410cc812a23362de9815e4c25d6287a74e0973.tar.gz bcm5719-llvm-41410cc812a23362de9815e4c25d6287a74e0973.zip |
Avoid a load for local functions.
llvm-svn: 271437
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index ef7304dafd3..c88cd50f3a1 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -1844,8 +1844,13 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI, const GlobalValue *GV = G->getGlobal(); isDirect = true; bool isDef = GV->isStrongDefinitionForLinker(); - bool isStub = (!isDef && Subtarget->isTargetMachO()) && - getTargetMachine().getRelocationModel() != Reloc::Static; + const TargetMachine &TM = getTargetMachine(); + Reloc::Model RM = TM.getRelocationModel(); + const Triple &TargetTriple = TM.getTargetTriple(); + bool isStub = + !shouldAssumeDSOLocal(RM, TargetTriple, *GV->getParent(), GV) && + Subtarget->isTargetMachO(); + isARMFunc = !Subtarget->isThumb() || (isStub && !Subtarget->isMClass()); // ARM call to a local ARM function is predicable. isLocalARMFunc = !Subtarget->isThumb() && (isDef || !ARMInterworking); |