Fix bug: ScalarRepl/2003-05-30-MultiLevel.ll

llvm-svn: 6428
This commit is contained in:
Chris Lattner 2003-05-30 05:26:30 +00:00
parent 0eef7c0d10
commit 38d88c07f4
1 changed files with 4 additions and 4 deletions

View File

@ -123,12 +123,12 @@ bool SROA::runOnFunction(Function &F) {
// expanded itself once the worklist is rerun.
//
std::string OldName = GEPI->getName(); // Steal the old name...
std::vector<Value*> NewArgs;
NewArgs.push_back(Constant::getNullValue(Type::LongTy));
NewArgs.insert(NewArgs.end(), GEPI->op_begin()+3, GEPI->op_end());
GEPI->setName("");
RepValue =
new GetElementPtrInst(AllocaToUse,
std::vector<Value*>(GEPI->op_begin()+3,
GEPI->op_end()),
OldName, GEPI);
new GetElementPtrInst(AllocaToUse, NewArgs, OldName, GEPI);
}
// Move all of the users over to the new GEP.