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:
ee69926
)
Phi nodes always use an even number of operands, so don't ever allocate
author
Jay Foad
<jay.foad@gmail.com>
Mon, 11 Apr 2011 09:25:51 +0000
(09:25 +0000)
committer
Jay Foad
<jay.foad@gmail.com>
Mon, 11 Apr 2011 09:25:51 +0000
(09:25 +0000)
an odd number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129270
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/VMCore/Instructions.cpp
patch
|
blob
|
history
diff --git
a/lib/VMCore/Instructions.cpp
b/lib/VMCore/Instructions.cpp
index 33dfcc032af1ac83d5838e7f4d73e6c2dea4ee89..61da9b6b8e0c2b9f6d2698ae1f1f73deaeb7b4e7 100644
(file)
--- a/
lib/VMCore/Instructions.cpp
+++ b/
lib/VMCore/Instructions.cpp
@@
-137,7
+137,8
@@
Value *PHINode::removeIncomingValue(unsigned Idx, bool DeletePHIIfEmpty) {
///
void PHINode::growOperands() {
unsigned e = getNumOperands();
- unsigned NumOps = e*3/2;
+ // Multiply by 1.5 and round down so the result is still even.
+ unsigned NumOps = e + e / 4 * 2;
if (NumOps < 4) NumOps = 4; // 4 op PHI nodes are VERY common.
ReservedSpace = NumOps;