summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2005-06-06 19:03:55 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2005-06-06 19:03:55 +0000
commitc74fe8445676b983407e731d9d7977258b0a5e28 (patch)
treeccca17b8b660962255192c671e4758c0b8c779f2 /llvm/lib
parentb07a3d71381503883528efadd1e7759ad40f445a (diff)
downloadbcm5719-llvm-c74fe8445676b983407e731d9d7977258b0a5e28.tar.gz
bcm5719-llvm-c74fe8445676b983407e731d9d7977258b0a5e28.zip
allow marking of loads and stores in the instruction stream with enough information to reconstruct the Value* if it existed
llvm-svn: 22195
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Alpha/AlphaISelPattern.cpp30
-rw-r--r--llvm/lib/Target/Alpha/AlphaInstrInfo.td1
2 files changed, 31 insertions, 0 deletions
diff --git a/llvm/lib/Target/Alpha/AlphaISelPattern.cpp b/llvm/lib/Target/Alpha/AlphaISelPattern.cpp
index ff5d268bf75..1f11065971d 100644
--- a/llvm/lib/Target/Alpha/AlphaISelPattern.cpp
+++ b/llvm/lib/Target/Alpha/AlphaISelPattern.cpp
@@ -45,6 +45,9 @@ namespace llvm {
cl::opt<bool> EnableAlphaCount("enable-alpha-count",
cl::desc("Print estimates on live ins and outs"),
cl::Hidden);
+ cl::opt<bool> EnableAlphaLSMark("enable-alpha-lsmark",
+ cl::desc("Emit symbols to corrolate Mem ops to LLVM Values"),
+ cl::Hidden);
}
namespace {
@@ -514,6 +517,27 @@ void ISel::EmitFunctionEntryCode(Function &Fn, MachineFunction &MF) {
}
}
+//Find the offset of the arg in it's parent's function
+static int getValueOffset(const Value* v)
+{
+ if (v == NULL)
+ return 0;
+
+ const Instruction* itarget = dyn_cast<Instruction>(v);
+ const BasicBlock* btarget = itarget->getParent();
+ const Function* ftarget = btarget->getParent();
+
+ //offset due to earlier BBs
+ int i = 0;
+ for(Function::const_iterator ii = ftarget->begin(); &*ii != btarget; ++ii)
+ i += ii->size();
+
+ for(BasicBlock::const_iterator ii = btarget->begin(); &*ii != itarget; ++ii)
+ ++i;
+
+ return i;
+}
+
//Factorize a number using the list of constants
static bool factorize(int v[], int res[], int size, uint64_t c)
{
@@ -1119,6 +1143,12 @@ unsigned ISel::SelectExprFP(SDOperand N, unsigned Result)
Select(Chain);
Opc = DestType == MVT::f64 ? Alpha::LDT : Alpha::LDS;
+ if (EnableAlphaLSMark)
+ {
+ int i = getValueOffset(dyn_cast<SrcValueSDNode>(N.getOperand(2))->getValue());
+ BuildMI(BB, Alpha::MEMLABEL, 2).addImm(i);
+ }
+
if (Address.getOpcode() == ISD::GlobalAddress) {
AlphaLowering.restoreGP(BB);
Opc = GetSymVersion(Opc);
diff --git a/llvm/lib/Target/Alpha/AlphaInstrInfo.td b/llvm/lib/Target/Alpha/AlphaInstrInfo.td
index c42ad1ed20f..bc29404ad1f 100644
--- a/llvm/lib/Target/Alpha/AlphaInstrInfo.td
+++ b/llvm/lib/Target/Alpha/AlphaInstrInfo.td
@@ -31,6 +31,7 @@ def ADJUSTSTACKUP : PseudoInstAlpha<(ops ), "ADJUP">;
def ADJUSTSTACKDOWN : PseudoInstAlpha<(ops ), "ADJDOWN">;
def ALTENT : PseudoInstAlpha<(ops s64imm:$TARGET), "$TARGET:\n">;
def PCLABEL : PseudoInstAlpha<(ops s64imm:$num), "PCMARKER_$num:\n">;
+def MEMLABEL : PseudoInstAlpha<(ops s64imm:$i), "LSMARKER_$i:\n">;
//*****************
//These are shortcuts, the assembler expands them
OpenPOWER on IntegriCloud