Closed
Description
[L2406] The new phi instruction NewPH
replacing the old phi instruction PH
and cast instruction ShadowUse
does not inherit any debug location.
[L2410] The new binop instruction NewIncr
replacing the old binop instruction Incr
does not inherit any debug location.
godbolt: https://godbolt.org/z/eGGd9Pxb5 (see %IV.S.
and %IV.S.next
in the optimized code)
/* Add new PHINode. */
-> PHINode *NewPH = PHINode::Create(DestTy, 2, "IV.S.", PH->getIterator());
/* create new increment. '++d' in above example. */
Constant *CFP = ConstantFP::get(DestTy, C->getZExtValue());
-> BinaryOperator *NewIncr = BinaryOperator::Create(
Incr->getOpcode() == Instruction::Add ? Instruction::FAdd
: Instruction::FSub,
NewPH, CFP, "IV.S.next.", Incr->getIterator());
NewPH->addIncoming(NewInit, PH->getIncomingBlock(Entry));
NewPH->addIncoming(NewIncr, PH->getIncomingBlock(Latch));
/* Remove cast operation */
ShadowUse->replaceAllUsesWith(NewPH);
ShadowUse->eraseFromParent();