summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-12-16 18:52:33 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-12-16 18:52:33 +0000
commit089c699743614cc99340c694454b4333c44d0198 (patch)
tree69da60047a32451224d356f72b076c54534d580c /llvm/lib/CodeGen/CodeGenPrepare.cpp
parentf624ec27b75701f1227eb03a44f3da84920c798d (diff)
downloadbcm5719-llvm-089c699743614cc99340c694454b4333c44d0198.tar.gz
bcm5719-llvm-089c699743614cc99340c694454b4333c44d0198.zip
Fix CodeGenPrepare::stripInvariantGroupMetadata
`dropUnknownNonDebugMetadata` takes a list of "known" metadata IDs. The only reason it worked at all is that `getMetadataID` returns something unrelated -- it returns the subclass ID of the receiver (which is used in `dyn_cast` etc.). That does not numerically match `LLVMContext::MD_invariant_group` and ends up dropping `invariant_group` along with every other metadata that does not numerically match `LLVMContext::MD_invariant_group`. llvm-svn: 289973
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 0ae57ce0c36..bc333b95ee0 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -5735,6 +5735,5 @@ bool CodeGenPrepare::splitBranchCondition(Function &F) {
}
void CodeGenPrepare::stripInvariantGroupMetadata(Instruction &I) {
- if (auto *InvariantMD = I.getMetadata(LLVMContext::MD_invariant_group))
- I.dropUnknownNonDebugMetadata(InvariantMD->getMetadataID());
+ I.setMetadata(LLVMContext::MD_invariant_group, nullptr);
}
OpenPOWER on IntegriCloud