projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
[LoopReroll] Don't crash on dead code
[oota-llvm.git]
/
lib
/
Transforms
/
Scalar
/
LoopRerollPass.cpp
diff --git
a/lib/Transforms/Scalar/LoopRerollPass.cpp
b/lib/Transforms/Scalar/LoopRerollPass.cpp
index 852f3ed9d51a6c6ffd1335f32380501cd9d063bc..704299f3041e916c924b97998abf6ffdfb9ef87f 100644
(file)
--- a/
lib/Transforms/Scalar/LoopRerollPass.cpp
+++ b/
lib/Transforms/Scalar/LoopRerollPass.cpp
@@
-511,6
+511,8
@@
void LoopReroll::SimpleLoopReduction::add(Loop *L) {
// (including the PHI), except for the last value (which is used by the PHI
// and also outside the loop).
Instruction *C = Instructions.front();
+ if (C->user_empty())
+ return;
do {
C = cast<Instruction>(*C->user_begin());