Chandler Carruth | 6acdca7 | 2017-01-24 12:55:57 +0000 | [diff] [blame] | 1 | ; Test that when a pass like correlated-propagation populates an analysis such |
| 2 | ; as LVI with references back into the IR of a function that the inliner will |
| 3 | ; delete, this doesn't crash or go awry despite the inliner clearing the analyses |
| 4 | ; separately from when it deletes the function. |
Chandler Carruth | 5144703 | 2017-01-23 07:53:20 +0000 | [diff] [blame] | 5 | ; |
| 6 | ; RUN: opt -debug-pass-manager -S < %s 2>&1 \ |
| 7 | ; RUN: -passes='cgscc(inline,function(correlated-propagation))' \ |
| 8 | ; RUN: | FileCheck %s |
| 9 | ; |
| 10 | ; CHECK-LABEL: Starting llvm::Module pass manager run. |
| 11 | ; CHECK: Running pass: InlinerPass on (callee) |
| 12 | ; CHECK: Running pass: CorrelatedValuePropagationPass on callee |
| 13 | ; CHECK: Running analysis: LazyValueAnalysis |
| 14 | ; CHECK: Running pass: InlinerPass on (caller) |
| 15 | ; CHECK: Clearing all analysis results for: callee |
| 16 | ; CHECK: Running pass: CorrelatedValuePropagationPass on caller |
| 17 | ; CHECK: Running analysis: LazyValueAnalysis |
| 18 | |
| 19 | define internal i32 @callee(i32 %x) { |
| 20 | ; CHECK-NOT: @callee |
| 21 | entry: |
| 22 | ret i32 %x |
| 23 | } |
| 24 | |
| 25 | define i32 @caller(i32 %x) { |
| 26 | ; CHECK-LABEL: define i32 @caller |
| 27 | entry: |
| 28 | %call = call i32 @callee(i32 %x) |
| 29 | ; CHECK-NOT: call |
| 30 | ret i32 %call |
| 31 | ; CHECK: ret i32 %x |
| 32 | } |