Skip to content

Commit ffb798c

Browse files
author
Devang Patel
committed
Set debug loc for new instructions.
llvm-svn: 130895
1 parent ac794d4 commit ffb798c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Transforms/Scalar/GVN.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,12 +952,12 @@ static Value *GetLoadValueForLoad(LoadInst *SrcVal, unsigned Offset,
952952
IntegerType::get(LoadTy->getContext(), NewLoadSize*8);
953953
DestPTy = PointerType::get(DestPTy,
954954
cast<PointerType>(PtrVal->getType())->getAddressSpace());
955-
955+
Builder.SetCurrentDebugLocation(SrcVal->getDebugLoc());
956956
PtrVal = Builder.CreateBitCast(PtrVal, DestPTy);
957957
LoadInst *NewLoad = Builder.CreateLoad(PtrVal);
958958
NewLoad->takeName(SrcVal);
959959
NewLoad->setAlignment(SrcVal->getAlignment());
960-
960+
961961
DEBUG(dbgs() << "GVN WIDENED LOAD: " << *SrcVal << "\n");
962962
DEBUG(dbgs() << "TO: " << *NewLoad << "\n");
963963

@@ -2118,7 +2118,7 @@ bool GVN::performPRE(Function &F) {
21182118

21192119
VN.add(Phi, ValNo);
21202120
addToLeaderTable(ValNo, Phi, CurrentBlock);
2121-
2121+
Phi->setDebugLoc(CurInst->getDebugLoc());
21222122
CurInst->replaceAllUsesWith(Phi);
21232123
if (Phi->getType()->isPointerTy()) {
21242124
// Because we have added a PHI-use of the pointer value, it has now

0 commit comments

Comments
 (0)