summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-08-22 23:37:20 +0000
committerChris Lattner <sabre@nondot.org>2002-08-22 23:37:20 +0000
commitdfb3a2cd07da96e9052ddd27bfef0d39b4587682 (patch)
tree82d36d1daf237563eba92c8c088547d80882373f /llvm/lib/CodeGen
parentbacb7273e8a1855cbf43dd3acf96657473a8344a (diff)
downloadbcm5719-llvm-dfb3a2cd07da96e9052ddd27bfef0d39b4587682.tar.gz
bcm5719-llvm-dfb3a2cd07da96e9052ddd27bfef0d39b4587682.zip
Eliminated the MemAccessInst class, folding contents into GEP class.
llvm-svn: 3487
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/InstrSelection/InstrForest.cpp7
-rw-r--r--llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp10
2 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/InstrSelection/InstrForest.cpp b/llvm/lib/CodeGen/InstrSelection/InstrForest.cpp
index eb9e7f940ed..91956f53a4d 100644
--- a/llvm/lib/CodeGen/InstrSelection/InstrForest.cpp
+++ b/llvm/lib/CodeGen/InstrSelection/InstrForest.cpp
@@ -67,11 +67,10 @@ InstructionNode::InstructionNode(Instruction* I)
{
opLabel = AllocaN; // Alloca(ptr, N) operation
}
- else if ((opLabel == Instruction::Load ||
- opLabel == Instruction::GetElementPtr) &&
- cast<MemAccessInst>(I)->hasIndices())
+ else if (opLabel == Instruction::GetElementPtr &&
+ cast<GetElementPtrInst>(I)->hasIndices())
{
- opLabel = opLabel + 100; // load/getElem with index vector
+ opLabel = opLabel + 100; // getElem with index vector
}
else if (opLabel == Instruction::Xor &&
BinaryOperator::isNot(I))
diff --git a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
index 914fec35762..294fdaec252 100644
--- a/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
+++ b/llvm/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp
@@ -111,8 +111,8 @@ Value*
FoldGetElemChain(const InstructionNode* getElemInstrNode,
vector<Value*>& chainIdxVec)
{
- MemAccessInst* getElemInst = (MemAccessInst*)
- getElemInstrNode->getInstruction();
+ GetElementPtrInst* getElemInst =
+ cast<GetElementPtrInst>(getElemInstrNode->getInstruction());
// Return NULL if we don't fold any instructions in.
Value* ptrVal = NULL;
@@ -128,9 +128,9 @@ FoldGetElemChain(const InstructionNode* getElemInstrNode,
ptrChild->getOpLabel() == GetElemPtrIdx)
{
// Child is a GetElemPtr instruction
- getElemInst = cast<MemAccessInst>(ptrChild->getValue());
- MemAccessInst::op_iterator OI, firstIdx = getElemInst->idx_begin();
- MemAccessInst::op_iterator lastIdx = getElemInst->idx_end();
+ getElemInst = cast<GetElementPtrInst>(ptrChild->getValue());
+ User::op_iterator OI, firstIdx = getElemInst->idx_begin();
+ User::op_iterator lastIdx = getElemInst->idx_end();
bool allConstantOffsets = true;
// Check that all offsets are constant for this instruction
OpenPOWER on IntegriCloud