forked from OSchip/llvm-project
Be more careful modifying the use_list while also iterating through it.
llvm-svn: 46417
This commit is contained in:
parent
053c9871cd
commit
efb16f7057
|
@ -365,8 +365,9 @@ bool LoopUnroll::unrollLoop(Loop *L, unsigned Count, unsigned Threshold) {
|
||||||
// be updated specially after unrolling all the way.
|
// be updated specially after unrolling all the way.
|
||||||
if (*BB != LatchBlock)
|
if (*BB != LatchBlock)
|
||||||
for (Value::use_iterator UI = (*BB)->use_begin(), UE = (*BB)->use_end();
|
for (Value::use_iterator UI = (*BB)->use_begin(), UE = (*BB)->use_end();
|
||||||
UI != UE; ++UI) {
|
UI != UE;) {
|
||||||
Instruction *UseInst = cast<Instruction>(*UI);
|
Instruction *UseInst = cast<Instruction>(*UI);
|
||||||
|
++UI;
|
||||||
if (isa<PHINode>(UseInst) && !L->contains(UseInst->getParent())) {
|
if (isa<PHINode>(UseInst) && !L->contains(UseInst->getParent())) {
|
||||||
PHINode *phi = cast<PHINode>(UseInst);
|
PHINode *phi = cast<PHINode>(UseInst);
|
||||||
Value *Incoming = phi->getIncomingValueForBlock(*BB);
|
Value *Incoming = phi->getIncomingValueForBlock(*BB);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
; RUN: llvm-as < %s | opt -disable-output -loop-unroll
|
; RUN: llvm-as < %s | opt -disable-output -loop-unroll
|
||||||
; PR1770
|
; PR1770
|
||||||
|
; PR1947
|
||||||
|
|
||||||
%struct.cl_engine = type { i32, i16, i32, i8**, i8**, i8*, i8*, i8*, i8*, i8*, i8*, i8* }
|
%struct.cl_engine = type { i32, i16, i32, i8**, i8**, i8*, i8*, i8*, i8*, i8*, i8*, i8* }
|
||||||
%struct.cl_limits = type { i32, i32, i32, i32, i16, i64 }
|
%struct.cl_limits = type { i32, i32, i32, i32, i16, i64 }
|
||||||
%struct.cli_ac_alt = type { i8, i8*, i16, i16, %struct.cli_ac_alt* }
|
%struct.cli_ac_alt = type { i8, i8*, i16, i16, %struct.cli_ac_alt* }
|
||||||
|
|
Loading…
Reference in New Issue