llvm.org GIT mirror llvm / d6c51ae
Merging r283129: ------------------------------------------------------------------------ r283129 | hans | 2016-10-03 11:18:04 -0700 (Mon, 03 Oct 2016) | 6 lines Jump threading: avoid trying to split edge into landingpad block (PR27840) Splitting the edge is nontrivial because of the landing pad, and we would currently assert trying to do it. Differential Revision: https://reviews.llvm.org/D24680 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@286246 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 2 years ago
2 changed file(s) with 37 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
13191319 // If the first instruction in BB isn't a phi, we won't be able to infer
13201320 // anything special about any particular predecessor.
13211321 if (!isa(BB->front()))
1322 return false;
1323
1324 // If this BB is a landing pad, we won't be able to split the edge into it.
1325 if (BB->isEHPad())
13221326 return false;
13231327
13241328 // If we have a xor as the branch input to this block, and we know that the
0 ; RUN: opt -jump-threading -S < %s | FileCheck %s
1
2 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-apple-macosx10.11.0"
4
5 declare void @helper()
6 declare i32 @__gxx_personality_v0(...)
7
8
9 define void @pr27840(i8* %call, i1 %A) personality i32(...)* @__gxx_personality_v0 {
10 entry:
11 invoke void @helper()
12 to label %invoke.cont unwind label %lpad
13
14 ; Don't jump threading; we can't split the critical edge from entry to lpad.
15 ; CHECK-LABEL: @pr27840
16 ; CHECK: invoke
17 ; CHECK-NEXT: to label %invoke.cont unwind label %lpad
18
19 invoke.cont:
20 invoke void @helper()
21 to label %nowhere unwind label %lpad
22
23 lpad:
24 %b = phi i1 [ true, %invoke.cont ], [ false, %entry ]
25 landingpad { i8*, i32 }
26 cleanup
27 %xor = xor i1 %b, %A
28 br i1 %xor, label %nowhere, label %invoke.cont
29
30 nowhere:
31 unreachable
32 }