diff options
author | Justin Holewinski <justin.holewinski@gmail.com> | 2011-09-27 18:12:55 +0000 |
---|---|---|
committer | Justin Holewinski <justin.holewinski@gmail.com> | 2011-09-27 18:12:55 +0000 |
commit | f47dfba023ec6db12cdfac0578c4d8229aecc2e4 (patch) | |
tree | a89b7c050f0c20c0be23e0a5d5eb6259af68e1c9 /lib/Target/PTX/PTXISelDAGToDAG.cpp | |
parent | 8e695eb5fa8ad9d62f92ec8ca8a542ffe5fd1ab5 (diff) | |
download | external_llvm-f47dfba023ec6db12cdfac0578c4d8229aecc2e4.zip external_llvm-f47dfba023ec6db12cdfac0578c4d8229aecc2e4.tar.gz external_llvm-f47dfba023ec6db12cdfac0578c4d8229aecc2e4.tar.bz2 |
PTX: Use external symbols to keep track of params and locals. This also fixes
a couple of outstanding issues with frame objects occuring as instruction
operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140616 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PTX/PTXISelDAGToDAG.cpp')
-rw-r--r-- | lib/Target/PTX/PTXISelDAGToDAG.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/Target/PTX/PTXISelDAGToDAG.cpp b/lib/Target/PTX/PTXISelDAGToDAG.cpp index d99d490..c722e8a 100644 --- a/lib/Target/PTX/PTXISelDAGToDAG.cpp +++ b/lib/Target/PTX/PTXISelDAGToDAG.cpp @@ -12,7 +12,9 @@ //===----------------------------------------------------------------------===// #include "PTX.h" +#include "PTXMachineFunctionInfo.h" #include "PTXTargetMachine.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/DerivedTypes.h" #include "llvm/Support/Debug.h" @@ -180,20 +182,14 @@ SDNode *PTXDAGToDAGISel::SelectWRITEPARAM(SDNode *Node) { SDNode *PTXDAGToDAGISel::SelectFrameIndex(SDNode *Node) { int FI = cast<FrameIndexSDNode>(Node)->getIndex(); //dbgs() << "Selecting FrameIndex at index " << FI << "\n"; - SDValue TFI = CurDAG->getTargetFrameIndex(FI, Node->getValueType(0)); + //SDValue TFI = CurDAG->getTargetFrameIndex(FI, Node->getValueType(0)); - //unsigned OpCode = PTX::LOAD_LOCAL_F32; + PTXMachineFunctionInfo *MFI = MF->getInfo<PTXMachineFunctionInfo>(); - //for (SDNode::use_iterator i = Node->use_begin(), e = Node->use_end(); - // i != e; ++i) { - // SDNode *Use = *i; - // dbgs() << "USE: "; - // Use->dumpr(CurDAG); - //} + SDValue FrameSymbol = CurDAG->getTargetExternalSymbol(MFI->getFrameSymbol(FI), + Node->getValueType(0)); - return Node; - //return CurDAG->getMachineNode(OpCode, Node->getDebugLoc(), - // Node->getValueType(0), TFI); + return FrameSymbol.getNode(); } // Match memory operand of the form [reg+reg] |