Remove much cruft from the MemAccessInst instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1298 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2001-11-14 11:27:58 +00:00
parent c2ae4f6d3b
commit 65ea171409
9 changed files with 41 additions and 41 deletions

View File

@@ -781,17 +781,16 @@ SetOperandsForMemInstr(MachineInstr* minstr,
// Use the pointer value and the index vector from the Mem instruction.
// If it is an array reference, get the array offset value.
//
ptrVal = memInst->getPtrOperand();
ptrVal = memInst->getPointerOperand();
const Type* opType =
((const PointerType*) ptrVal->getType())->getValueType();
const Type* opType = cast<PointerType>(ptrVal->getType())->getValueType();
if (opType->isArrayType())
{
assert((memInst->getNumOperands()
== (unsigned) 1 + memInst->getFirstOffsetIdx())
== (unsigned) 1 + memInst->getFirstIndexOperandNumber())
&& "Array refs must be lowered before Instruction Selection");
arrayOffsetVal = memInst->getOperand(memInst->getFirstOffsetIdx());
arrayOffsetVal = memInst->getOperand(memInst->getFirstIndexOperandNumber());
}
}
@@ -1835,7 +1834,7 @@ GetInstructionsByRule(InstructionNode* subtreeRoot,
GetElementPtrInst* getElemInst =
cast<GetElementPtrInst>(subtreeRoot->getInstruction());
const PointerType* ptrType =
(const PointerType*) getElemInst->getPtrOperand()->getType();
cast<PointerType>(getElemInst->getPointerOperand()->getType());
if (! ptrType->getValueType()->isArrayType())
{// we don't need a separate instr
numInstr = 0; // don't forward operand!