summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PseudoSourceValue.cpp
diff options
context:
space:
mode:
authorJan Sjodin <jan_sjodin@yahoo.com>2017-09-14 20:53:51 +0000
committerJan Sjodin <jan_sjodin@yahoo.com>2017-09-14 20:53:51 +0000
commit312ccf761c034483f6bdcd659c44f56bc9818d96 (patch)
treeed9b9d8ec4c3adfa76dbed215779cc942c84dd5d /llvm/lib/CodeGen/PseudoSourceValue.cpp
parentf65177a41f6688a79c88aaddefcdc484258c2142 (diff)
downloadbcm5719-llvm-312ccf761c034483f6bdcd659c44f56bc9818d96.tar.gz
bcm5719-llvm-312ccf761c034483f6bdcd659c44f56bc9818d96.zip
Add AddresSpace to PseudoSourceValue.
Differential Revision: https://reviews.llvm.org/D35089 llvm-svn: 313297
Diffstat (limited to 'llvm/lib/CodeGen/PseudoSourceValue.cpp')
-rw-r--r--llvm/lib/CodeGen/PseudoSourceValue.cpp45
1 files changed, 28 insertions, 17 deletions
diff --git a/llvm/lib/CodeGen/PseudoSourceValue.cpp b/llvm/lib/CodeGen/PseudoSourceValue.cpp
index b29e62bf1aa..5fa5587457d 100644
--- a/llvm/lib/CodeGen/PseudoSourceValue.cpp
+++ b/llvm/lib/CodeGen/PseudoSourceValue.cpp
@@ -14,6 +14,7 @@
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
+#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Support/ErrorHandling.h"
@@ -24,7 +25,11 @@ static const char *const PSVNames[] = {
"Stack", "GOT", "JumpTable", "ConstantPool", "FixedStack",
"GlobalValueCallEntry", "ExternalSymbolCallEntry"};
-PseudoSourceValue::PseudoSourceValue(PSVKind Kind) : Kind(Kind) {}
+PseudoSourceValue::PseudoSourceValue(PSVKind Kind, const TargetInstrInfo &TII)
+ : Kind(Kind) {
+ AddressSpace = TII.getAddressSpaceForPseudoSourceKind(Kind);
+}
+
PseudoSourceValue::~PseudoSourceValue() {}
@@ -75,8 +80,9 @@ void FixedStackPseudoSourceValue::printCustom(raw_ostream &OS) const {
OS << "FixedStack" << FI;
}
-CallEntryPseudoSourceValue::CallEntryPseudoSourceValue(PSVKind Kind)
- : PseudoSourceValue(Kind) {}
+CallEntryPseudoSourceValue::CallEntryPseudoSourceValue(
+ PSVKind Kind, const TargetInstrInfo &TII)
+ : PseudoSourceValue(Kind, TII) {}
bool CallEntryPseudoSourceValue::isConstant(const MachineFrameInfo *) const {
return false;
@@ -91,16 +97,20 @@ bool CallEntryPseudoSourceValue::mayAlias(const MachineFrameInfo *) const {
}
GlobalValuePseudoSourceValue::GlobalValuePseudoSourceValue(
- const GlobalValue *GV)
- : CallEntryPseudoSourceValue(GlobalValueCallEntry), GV(GV) {}
-
-ExternalSymbolPseudoSourceValue::ExternalSymbolPseudoSourceValue(const char *ES)
- : CallEntryPseudoSourceValue(ExternalSymbolCallEntry), ES(ES) {}
-
-PseudoSourceValueManager::PseudoSourceValueManager()
- : StackPSV(PseudoSourceValue::Stack), GOTPSV(PseudoSourceValue::GOT),
- JumpTablePSV(PseudoSourceValue::JumpTable),
- ConstantPoolPSV(PseudoSourceValue::ConstantPool) {}
+ const GlobalValue *GV,
+ const TargetInstrInfo &TII)
+ : CallEntryPseudoSourceValue(GlobalValueCallEntry, TII), GV(GV) {}
+ExternalSymbolPseudoSourceValue::ExternalSymbolPseudoSourceValue(
+ const char *ES, const TargetInstrInfo &TII)
+ : CallEntryPseudoSourceValue(ExternalSymbolCallEntry, TII), ES(ES) {}
+
+PseudoSourceValueManager::PseudoSourceValueManager(
+ const TargetInstrInfo &TIInfo)
+ : TII(TIInfo),
+ StackPSV(PseudoSourceValue::Stack, TII),
+ GOTPSV(PseudoSourceValue::GOT, TII),
+ JumpTablePSV(PseudoSourceValue::JumpTable, TII),
+ ConstantPoolPSV(PseudoSourceValue::ConstantPool, TII) {}
const PseudoSourceValue *PseudoSourceValueManager::getStack() {
return &StackPSV;
@@ -116,10 +126,11 @@ const PseudoSourceValue *PseudoSourceValueManager::getJumpTable() {
return &JumpTablePSV;
}
-const PseudoSourceValue *PseudoSourceValueManager::getFixedStack(int FI) {
+const PseudoSourceValue *
+PseudoSourceValueManager::getFixedStack(int FI) {
std::unique_ptr<FixedStackPseudoSourceValue> &V = FSValues[FI];
if (!V)
- V = llvm::make_unique<FixedStackPseudoSourceValue>(FI);
+ V = llvm::make_unique<FixedStackPseudoSourceValue>(FI, TII);
return V.get();
}
@@ -128,7 +139,7 @@ PseudoSourceValueManager::getGlobalValueCallEntry(const GlobalValue *GV) {
std::unique_ptr<const GlobalValuePseudoSourceValue> &E =
GlobalCallEntries[GV];
if (!E)
- E = llvm::make_unique<GlobalValuePseudoSourceValue>(GV);
+ E = llvm::make_unique<GlobalValuePseudoSourceValue>(GV, TII);
return E.get();
}
@@ -137,6 +148,6 @@ PseudoSourceValueManager::getExternalSymbolCallEntry(const char *ES) {
std::unique_ptr<const ExternalSymbolPseudoSourceValue> &E =
ExternalCallEntries[ES];
if (!E)
- E = llvm::make_unique<ExternalSymbolPseudoSourceValue>(ES);
+ E = llvm::make_unique<ExternalSymbolPseudoSourceValue>(ES, TII);
return E.get();
}
OpenPOWER on IntegriCloud