Set debug loc for new load instruction.
authorDevang Patel <dpatel@apple.com>
Tue, 17 May 2011 19:43:38 +0000 (19:43 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 17 May 2011 19:43:38 +0000 (19:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131481 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/GVN.cpp

index c47fae1825a7caba5555b78fc519920a9fa202ff..cbb030e56060b6922c38da558c26aecb5f45cf44 100644 (file)
@@ -1576,6 +1576,9 @@ bool GVN::processNonLocalLoad(LoadInst *LI) {
     if (MDNode *Tag = LI->getMetadata(LLVMContext::MD_tbaa))
       NewLoad->setMetadata(LLVMContext::MD_tbaa, Tag);
 
+    // Transfer DebugLoc.
+    NewLoad->setDebugLoc(LI->getDebugLoc());
+
     // Add the newly created load.
     ValuesPerBlock.push_back(AvailableValueInBlock::get(UnavailablePred,
                                                         NewLoad));