Secondly, checking whether removal succeeded tells you whether it was in
the map to begin with.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37469
91177308-0d34-0410-b5e6-
96231b3b80d8
for (Instruction::use_iterator UI = II->use_begin(), UE = II->use_end();
UI != UE; ++UI) {
- Instruction *Inst = dyn_cast<Instruction>(*UI);
- if (Inst && hasSCEV(Inst) && Scalars.erase(Inst)) {
+ Instruction *Inst = cast<Instruction>(*UI);
+ if (Scalars.erase(Inst)) {
if (PHINode *PN = dyn_cast<PHINode>(II))
ConstantEvolutionLoopExitValue.erase(PN);
Worklist.push_back(Inst);