[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / Transforms / LoopUnswitch / 2012-04-02-IndirectBr.ll
blob660cc7115c808f6595ebcf3622df90d5cf0680a8
1 ; RUN: opt < %s -S -loop-unswitch -enable-new-pm=0 -verify-loop-info -verify-dom-info -verify-memoryssa | FileCheck %s
2 ; PR12343: -loop-unswitch -enable-new-pm=0 crash on indirect branch
4 ; CHECK:       %0 = icmp eq i64 undef, 0
5 ; CHECK-NEXT:  br i1 %0, label %"5", label %"4"
7 ; CHECK:       "5":                                              ; preds = %entry
8 ; CHECK-NEXT:  br label %"16"
10 ; CHECK:       "16":                                             ; preds = %"22", %"5"
11 ; CHECK-NEXT:  indirectbr i8* undef, [label %"22", label %"33"]
13 ; CHECK:       "22":                                             ; preds = %"16"
14 ; CHECK-NEXT:  br i1 %0, label %"16", label %"26"
16 ; CHECK:       "26":                                             ; preds = %"22"
17 ; CHECK-NEXT:  unreachable
19 define void @foo() {
20 entry:
21   %0 = icmp eq i64 undef, 0
22   br i1 %0, label %"5", label %"4"
24 "4":                                              ; preds = %entry
25   unreachable
27 "5":                                              ; preds = %entry
28   br label %"16"
30 "16":                                             ; preds = %"22", %"5"
31   indirectbr i8* undef, [label %"22", label %"33"]
33 "22":                                             ; preds = %"16"
34   br i1 %0, label %"16", label %"26"
36 "26":                                             ; preds = %"22"
37   unreachable
39 "33":                                             ; preds = %"16"
40   unreachable