OSDN Git Service

Fix CodeGenPrepare::stripInvariantGroupMetadata
authorSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 16 Dec 2016 18:52:33 +0000 (18:52 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Fri, 16 Dec 2016 18:52:33 +0000 (18:52 +0000)
commit83c848589954188246c59604106ccd8f691a1b2c
treef0cd1fcfe92ee57a6c26e36313bbbc4ada7a5f1a
parent59768451f253c5845b2ec5e42c94970285594ffa
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`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289973 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenPrepare.cpp
test/Transforms/CodeGenPrepare/invariant.group.ll