summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/GVN.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-08-20 18:24:02 +0000
committerAdrian Prantl <aprantl@apple.com>2015-08-20 18:24:02 +0000
commitbaf90fc2658bac897abfc3375596d40af53c0521 (patch)
tree828bf4764ee3d5b5491ec821358b0788050895b0 /llvm/lib/Transforms/Scalar/GVN.cpp
parenta317cd2583868c2a21019163be0219a0300518f2 (diff)
downloadbcm5719-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/GVN.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index d898b1796b6..cbb9c1bc00b 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -1780,6 +1780,7 @@ static void patchReplacementInstruction(Instruction *I, Value *Repl) {
// regions, and so we need a conservative combination of the noalias
// scopes.
static const unsigned KnownIDs[] = {
+ LLVMContext::MD_dbg,
LLVMContext::MD_tbaa,
LLVMContext::MD_alias_scope,
LLVMContext::MD_noalias,
OpenPOWER on IntegriCloud