r234638 chained another transform below which was tripping over the
deleted instruction. Use after free found by asan in many regression
tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234654
91177308-0d34-0410-b5e6-
96231b3b80d8
InsertedCast =
CastInst::Create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "",
InsertPt);
InsertedCast =
CastInst::Create(CI->getOpcode(), CI->getOperand(0), CI->getType(), "",
InsertPt);
}
// Replace a use of the cast with a use of the new cast.
TheUse = InsertedCast;
}
// Replace a use of the cast with a use of the new cast.
TheUse = InsertedCast;
CmpInst::Create(CI->getOpcode(),
CI->getPredicate(), CI->getOperand(0),
CI->getOperand(1), "", InsertPt);
CmpInst::Create(CI->getOpcode(),
CI->getPredicate(), CI->getOperand(0),
CI->getOperand(1), "", InsertPt);
}
// Replace a use of the cmp with a use of the new cmp.
TheUse = InsertedCmp;
}
// Replace a use of the cmp with a use of the new cmp.
TheUse = InsertedCmp;
++NumCmpUses;
}
// If we removed all uses, nuke the cmp.
++NumCmpUses;
}
// If we removed all uses, nuke the cmp.