@@ -929,9 +929,10 @@ bool JumpThreading::SimplifyPartiallyRedundantLoad(LoadInst *LI) {
929
929
if (UnavailablePred) {
930
930
assert (UnavailablePred->getTerminator ()->getNumSuccessors () == 1 &&
931
931
" Can't handle critical edge here!" );
932
- Value *NewVal = new LoadInst (LoadedPtr, LI->getName ()+" .pr" , false ,
932
+ LoadInst *NewVal = new LoadInst (LoadedPtr, LI->getName ()+" .pr" , false ,
933
933
LI->getAlignment (),
934
934
UnavailablePred->getTerminator ());
935
+ NewVal->setDebugLoc (LI->getDebugLoc ());
935
936
AvailablePreds.push_back (std::make_pair (UnavailablePred, NewVal));
936
937
}
937
938
@@ -944,6 +945,7 @@ bool JumpThreading::SimplifyPartiallyRedundantLoad(LoadInst *LI) {
944
945
PHINode *PN = PHINode::Create (LI->getType (), std::distance (PB, PE), " " ,
945
946
LoadBB->begin ());
946
947
PN->takeName (LI);
948
+ PN->setDebugLoc (LI->getDebugLoc ());
947
949
948
950
// Insert new entries into the PHI for each predecessor. A single block may
949
951
// have multiple entries here.
@@ -1375,7 +1377,8 @@ bool JumpThreading::ThreadEdge(BasicBlock *BB,
1375
1377
1376
1378
// We didn't copy the terminator from BB over to NewBB, because there is now
1377
1379
// an unconditional jump to SuccBB. Insert the unconditional jump.
1378
- BranchInst::Create (SuccBB, NewBB);
1380
+ BranchInst *NewBI =BranchInst::Create (SuccBB, NewBB);
1381
+ NewBI->setDebugLoc (BB->getTerminator ()->getDebugLoc ());
1379
1382
1380
1383
// Check to see if SuccBB has PHI nodes. If so, we need to add entries to the
1381
1384
// PHI nodes for NewBB now.
0 commit comments