Replace CastInst::createInferredCast calls with more accurate cast

creation calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32521 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2006-12-13 00:50:17 +00:00
parent 31b628ba60
commit 7b06bd532d
9 changed files with 54 additions and 52 deletions

View File

@@ -258,8 +258,8 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
// The existing and new operand 0 types are different so we must
// replace CI with a new CastInst so that we are assured to
// get the correct cast opcode.
CastInst *NewCI = CastInst::createInferredCast(
GEP, CI->getType(), CI->getName(), CI);
CastInst *NewCI = new BitCastInst(GEP, CI->getType(),
CI->getName(), CI);
CI->replaceAllUsesWith(NewCI);
CI->eraseFromParent();
CI = NewCI;