llvm.org GIT mirror llvm / e536ca6
[MemorySSA] Check for unreachable blocks when getting last definition. If a single predecessor is found, still check if the block is unreachable. The test that found this had a self loop unreachable block. Resolves PR43493. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373383 91177308-0d34-0410-b5e6-96231b3b80d8 Alina Sbirlea 1 year, 19 days ago
2 changed file(s) with 30 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
838838 } else {
839839 // Single predecessor, BB cannot be dead. GetLastDef of Pred.
840840 assert(Count == 1 && Pred && "Single predecessor expected.");
841 // BB can be unreachable though, return LoE if that is the case.
842 if (!DT.getNode(BB))
843 return MSSA->getLiveOnEntryDef();
841844 BB = Pred;
842845 }
843846 };
0 ; RUN: opt -enable-mssa-loop-dependency=true -loop-rotate -verify-memoryssa -S %s | FileCheck %s
1 ; REQUIRES: asserts
2
3 ; CHECK-LABEL: @func_35()
4 define void @func_35() {
5 entry:
6 br i1 undef, label %for.cond1704.preheader, label %return
7
8 for.cond1704.preheader: ; preds = %entry
9 br label %for.cond1704
10
11 for.cond1704: ; preds = %for.cond1704.preheader, %for.body1707
12 br i1 false, label %for.body1707, label %return.loopexit
13
14 for.body1707: ; preds = %for.cond1704
15 store i32 1712, i32* undef, align 1
16 br label %for.cond1704
17
18 for.body1102: ; preds = %for.body1102
19 br i1 undef, label %for.body1102, label %return
20
21 return.loopexit: ; preds = %for.cond1704
22 br label %return
23
24 return: ; preds = %return.loopexit, %for.body1102, %entry
25 ret void
26 }