There is only one case where GVRequiresExtraLoad returns true for calls:
split its handling out to PCRelGVRequiresExtraLoad, and simplify code
based on this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75230 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86Subtarget.h b/lib/Target/X86/X86Subtarget.h
index db3b5d5..b2e518e 100644
--- a/lib/Target/X86/X86Subtarget.h
+++ b/lib/Target/X86/X86Subtarget.h
@@ -204,10 +204,16 @@
bool GVRequiresExtraLoad(const GlobalValue* GV, const TargetMachine &TM,
bool isDirectCall) const;
+ /// PCRelGVRequiresExtraLoad - True if accessing the GV from a PC-relative
+ /// operand like a call target requires an extra load.
+ bool PCRelGVRequiresExtraLoad(const GlobalValue *GV,
+ const TargetMachine &TM) const;
+
+
/// True if accessing the GV requires a register. This is a superset of the
/// cases where GVRequiresExtraLoad is true. Some variations of PIC require
/// a register, but not an extra load.
- bool GVRequiresRegister(const GlobalValue* GV, const TargetMachine &TM) const;
+ bool GVRequiresRegister(const GlobalValue *GV, const TargetMachine &TM) const;
/// IsLegalToCallImmediateAddr - Return true if the subtarget allows calls
/// to immediate address.