mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-02 08:45:55 +00:00
insert some sequence points and preincrement an iterator to avoid
iterator invalidation problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bce4afe839
commit
f49a28cd02
@ -1205,10 +1205,10 @@ static void RewriteHeapSROALoadUser(Instruction *LoadUser,
|
|||||||
|
|
||||||
// If this is the first time we've seen this PHI, recursively process all
|
// If this is the first time we've seen this PHI, recursively process all
|
||||||
// users.
|
// users.
|
||||||
for (Value::use_iterator UI = PN->use_begin(), E = PN->use_end(); UI != E;
|
for (Value::use_iterator UI = PN->use_begin(), E = PN->use_end(); UI != E; ) {
|
||||||
++UI)
|
Instruction *User = cast<Instruction>(*UI++);
|
||||||
RewriteHeapSROALoadUser(cast<Instruction>(*UI), InsertedScalarizedValues,
|
RewriteHeapSROALoadUser(User, InsertedScalarizedValues, PHIsToRewrite);
|
||||||
PHIsToRewrite);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// RewriteUsesOfLoadForHeapSRoA - We are performing Heap SRoA on a global. Ptr
|
/// RewriteUsesOfLoadForHeapSRoA - We are performing Heap SRoA on a global. Ptr
|
||||||
@ -1219,9 +1219,10 @@ static void RewriteUsesOfLoadForHeapSRoA(LoadInst *Load,
|
|||||||
DenseMap<Value*, std::vector<Value*> > &InsertedScalarizedValues,
|
DenseMap<Value*, std::vector<Value*> > &InsertedScalarizedValues,
|
||||||
std::vector<std::pair<PHINode*, unsigned> > &PHIsToRewrite) {
|
std::vector<std::pair<PHINode*, unsigned> > &PHIsToRewrite) {
|
||||||
for (Value::use_iterator UI = Load->use_begin(), E = Load->use_end();
|
for (Value::use_iterator UI = Load->use_begin(), E = Load->use_end();
|
||||||
UI != E; )
|
UI != E; ) {
|
||||||
RewriteHeapSROALoadUser(cast<Instruction>(*UI++), InsertedScalarizedValues,
|
Instruction *User = cast<Instruction>(*UI++);
|
||||||
PHIsToRewrite);
|
RewriteHeapSROALoadUser(User, InsertedScalarizedValues, PHIsToRewrite);
|
||||||
|
}
|
||||||
|
|
||||||
if (Load->use_empty()) {
|
if (Load->use_empty()) {
|
||||||
Load->eraseFromParent();
|
Load->eraseFromParent();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user