diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-08-20 18:24:02 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-08-20 18:24:02 +0000 |
commit | baf90fc2658bac897abfc3375596d40af53c0521 (patch) | |
tree | 828bf4764ee3d5b5491ec821358b0788050895b0 /llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp | |
parent | a317cd2583868c2a21019163be0219a0300518f2 (diff) | |
download | bcm5719-llvm-baf90fc2658bac897abfc3375596d40af53c0521.tar.gz bcm5719-llvm-baf90fc2658bac897abfc3375596d40af53c0521.zip |
Fix a bug that caused SimplifyCFG to drop DebugLocs.
Instruction::dropUnknownMetadata(KnownSet) is supposed to preserve all
metadata in KnownSet, but the condition for DebugLocs was inverted.
Most users of dropUnknownMetadata() actually worked around this by not
adding LLVMContext::MD_dbg to their list of KnowIDs.
This is now made explicit.
llvm-svn: 245589
Diffstat (limited to 'llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp index 6a094b2a7a1..7feb0cd1df6 100644 --- a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp +++ b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp @@ -293,7 +293,7 @@ void MergedLoadStoreMotion::hoistInstruction(BasicBlock *BB, // Intersect optional metadata. HoistCand->intersectOptionalDataWith(ElseInst); - HoistCand->dropUnknownMetadata(); + HoistCand->dropUnknownMetadata(LLVMContext::MD_dbg); // Prepend point for instruction insert Instruction *HoistPt = BB->getTerminator(); @@ -472,7 +472,7 @@ bool MergedLoadStoreMotion::sinkStore(BasicBlock *BB, StoreInst *S0, BasicBlock::iterator InsertPt = BB->getFirstInsertionPt(); // Intersect optional metadata. S0->intersectOptionalDataWith(S1); - S0->dropUnknownMetadata(); + S0->dropUnknownMetadata(LLVMContext::MD_dbg); // Create the new store to be inserted at the join point. StoreInst *SNew = (StoreInst *)(S0->clone()); |