summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-08-29 17:14:08 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-08-29 17:14:08 +0000
commite8fd5f9ffdd72fc9cfe7bd6070417cacd859ae18 (patch)
tree590ab7ccf47a3f3c83e2b2c7d640e1e02c2f928c /llvm/lib
parentcfec5ff1b95a3e74623f096f24367a3ef23dcb5c (diff)
downloadbcm5719-llvm-e8fd5f9ffdd72fc9cfe7bd6070417cacd859ae18.tar.gz
bcm5719-llvm-e8fd5f9ffdd72fc9cfe7bd6070417cacd859ae18.zip
[SimplifyCFG] Hoisting invalidates metadata
We forgot to remove optimization metadata when performing hosting during FoldTwoEntryPHINode. This fixes PR29163. llvm-svn: 279980
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index d11f4e85c3d..59f416ebf0f 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -2110,14 +2110,20 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetTransformInfo &TTI,
// Move all 'aggressive' instructions, which are defined in the
// conditional parts of the if's up to the dominating block.
- if (IfBlock1)
+ if (IfBlock1) {
+ for (auto &I : *IfBlock1)
+ I.dropUnknownNonDebugMetadata();
DomBlock->getInstList().splice(InsertPt->getIterator(),
IfBlock1->getInstList(), IfBlock1->begin(),
IfBlock1->getTerminator()->getIterator());
- if (IfBlock2)
+ }
+ if (IfBlock2) {
+ for (auto &I : *IfBlock2)
+ I.dropUnknownNonDebugMetadata();
DomBlock->getInstList().splice(InsertPt->getIterator(),
IfBlock2->getInstList(), IfBlock2->begin(),
IfBlock2->getTerminator()->getIterator());
+ }
while (PHINode *PN = dyn_cast<PHINode>(BB->begin())) {
// Change the PHI node into a select instruction.
OpenPOWER on IntegriCloud