mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
[LoopReroll] Don't crash on dead code
If a PHI has no users, don't crash; bail gracefully. This shouldn't happen often, but we can make no guarantees that previous passes didn't leave dead code around. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229405 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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());
|
||||
|
Reference in New Issue
Block a user