1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

jump threading can't split a critical edge from an indirectbr. This

fixes PR7356.

llvm-svn: 105950
This commit is contained in:
Chris Lattner 2010-06-14 19:45:43 +00:00
parent ff21828dce
commit 88d51b0f4c
2 changed files with 28 additions and 1 deletions

View File

@ -870,9 +870,14 @@ bool JumpThreading::SimplifyPartiallyRedundantLoad(LoadInst *LI) {
// Add all the unavailable predecessors to the PredsToSplit list.
for (pred_iterator PI = pred_begin(LoadBB), PE = pred_end(LoadBB);
PI != PE; ++PI)
PI != PE; ++PI) {
// If the predecessor is an indirect goto, we can't split the edge.
if (isa<IndirectBrInst>((*PI)->getTerminator()))
return false;
if (!AvailablePredSet.count(*PI))
PredsToSplit.push_back(*PI);
}
// Split them out to their own block.
UnavailablePred =

View File

@ -341,3 +341,25 @@ if.end12: ; preds = %if.then, %lbl_51
ret void
}
; PR7356
define i32 @test13(i32* %P, i8* %Ptr) {
entry:
indirectbr i8* %Ptr, [label %BrBlock, label %B2]
B2:
store i32 4, i32 *%P
br label %BrBlock
BrBlock:
%L = load i32* %P
%C = icmp eq i32 %L, 42
br i1 %C, label %T, label %F
T:
ret i32 123
F:
ret i32 1422
}