projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa79721
)
PGO: create metadata for switch only if it has more than one targets.
author
Manman Ren
<mren@apple.com>
Thu, 11 Oct 2012 22:28:34 +0000
(22:28 +0000)
committer
Manman Ren
<mren@apple.com>
Thu, 11 Oct 2012 22:28:34 +0000
(22:28 +0000)
When all cases of a switch statement are dead, the weights vector only has one
element, and we will get an ssertion failure when calling createBranchWeights.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165759
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Utils/SimplifyCFG.cpp
b/lib/Transforms/Utils/SimplifyCFG.cpp
index af8d112852383141ac74909d1615957fe35b2d70..5f8953abc07ab813c60e9c0b3e5ee2749cc0511e 100644
(file)
--- a/
lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/
lib/Transforms/Utils/SimplifyCFG.cpp
@@
-695,7
+695,7
@@
SimplifyEqualityComparisonWithOnlyPredecessor(TerminatorInst *TI,
SI->removeCase(i);
}
}
- if (HasWeight)
+ if (HasWeight
&& Weights.size() >= 2
)
SI->setMetadata(LLVMContext::MD_prof,
MDBuilder(SI->getParent()->getContext()).
createBranchWeights(Weights));