* Fix bug in LevelRaise.cpp, correcting this problem:
test/Regression/Transforms/LevelRaise/2002-07-16-RaiseCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2920
91177308-0d34-0410-b5e6-
96231b3b80d8
Instruction *I = cast<Instruction>(U); // Only Instructions convertable
BasicBlock *BB = I->getParent();
+ assert(BB != 0 && "Instruction not embedded in basic block!");
BasicBlock::InstListType &BIL = BB->getInstList();
std::string Name = I->getName(); if (!Name.empty()) I->setName("");
Instruction *Res; // Result of conversion
// source type of the cast...
//
ConvertedTypes.clear();
+ ConvertedTypes[CI] = Src->getType(); // Make sure the cast _does_ change
if (ValueConvertableToType(CI, Src->getType(), ConvertedTypes)) {
PRINT_PEEPHOLE3("CAST-DEST-EXPR-CONV:in ", Src, CI, BB->getParent());