121
|
1 ; RUN: opt < %s -inline -instcombine -S | FileCheck %s
|
|
2
|
|
3 ; This test case exposed a bug in instcombine where the early
|
|
4 ; DCE of a call wasn't recognized as changing the IR.
|
|
5 ; So when runOnFunction propagated the "made changes" upwards
|
|
6 ; to the CallGraphSCCPass it signalled that no changes had been
|
|
7 ; made, so CallGraphSCCPass assumed that the old CallGraph,
|
|
8 ; as known by that pass manager, still was up-to-date.
|
|
9 ;
|
|
10 ; This was detected as an assert when trying to remove the
|
|
11 ; no longer used function 'bar' (due to incorrect reference
|
|
12 ; count in the CallGraph).
|
|
13
|
|
14 attributes #0 = { noinline norecurse nounwind readnone }
|
|
15
|
|
16 define void @foo() #0 {
|
|
17 ; CHECK-LABEL: @foo(
|
|
18 ; CHECK-NEXT: entry:
|
|
19 ; CHECK-NEXT: ret void
|
|
20 ;
|
|
21 entry:
|
|
22 %call = call i32 @bar()
|
|
23 ret void
|
|
24 }
|
|
25
|
|
26 define internal i32 @bar() #0 {
|
|
27 ; CHECK-NOT: bar
|
|
28 entry:
|
|
29 ret i32 42
|
|
30 }
|
|
31
|