mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-26 21:20:37 +00:00
Set debug loc for new instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130895 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a922ba7edc
commit
0f18d97fd1
@ -952,12 +952,12 @@ static Value *GetLoadValueForLoad(LoadInst *SrcVal, unsigned Offset,
|
||||
IntegerType::get(LoadTy->getContext(), NewLoadSize*8);
|
||||
DestPTy = PointerType::get(DestPTy,
|
||||
cast<PointerType>(PtrVal->getType())->getAddressSpace());
|
||||
|
||||
Builder.SetCurrentDebugLocation(SrcVal->getDebugLoc());
|
||||
PtrVal = Builder.CreateBitCast(PtrVal, DestPTy);
|
||||
LoadInst *NewLoad = Builder.CreateLoad(PtrVal);
|
||||
NewLoad->takeName(SrcVal);
|
||||
NewLoad->setAlignment(SrcVal->getAlignment());
|
||||
|
||||
|
||||
DEBUG(dbgs() << "GVN WIDENED LOAD: " << *SrcVal << "\n");
|
||||
DEBUG(dbgs() << "TO: " << *NewLoad << "\n");
|
||||
|
||||
@ -2118,7 +2118,7 @@ bool GVN::performPRE(Function &F) {
|
||||
|
||||
VN.add(Phi, ValNo);
|
||||
addToLeaderTable(ValNo, Phi, CurrentBlock);
|
||||
|
||||
Phi->setDebugLoc(CurInst->getDebugLoc());
|
||||
CurInst->replaceAllUsesWith(Phi);
|
||||
if (Phi->getType()->isPointerTy()) {
|
||||
// Because we have added a PHI-use of the pointer value, it has now
|
||||
|
Loading…
Reference in New Issue
Block a user