mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-14 07:09:08 +00:00
The first PHI node may be null, scan for the first non-null one
llvm-svn: 8865
This commit is contained in:
parent
a5fd39ee21
commit
ada012bfcd
@ -158,7 +158,10 @@ void PromoteMem2Reg::run() {
|
||||
// Only do work here if there the PHI nodes are missing incoming values. We
|
||||
// know that all PHI nodes that were inserted in a block will have the same
|
||||
// number of incoming values, so we can just check any PHI node.
|
||||
PHINode *FirstPHI = PNs[0];
|
||||
PHINode *FirstPHI;
|
||||
for (unsigned i = 0; (FirstPHI = PNs[i]) == 0; ++i)
|
||||
/*empty*/;
|
||||
|
||||
if (Preds.size() != FirstPHI->getNumIncomingValues()) {
|
||||
// Ok, now we know that all of the PHI nodes are missing entries for some
|
||||
// basic blocks. Start by sorting the incoming predecessors for efficient
|
||||
|
Loading…
Reference in New Issue
Block a user