1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -passes='require<demanded-bits>,constraint-elimination,require<demanded-bits>' -disable-verify -verify-analysis-invalidation=false -debug-pass-manager -disable-output %s 2>&1 | FileCheck %s
4 ; Check that constraint-elimination properly invalidates anlyses.
6 ; FIXME: ssub simplification currently doesn't properly set the change status
7 ; after modifying the IR, which causes DemandedBits to be preserved.
9 ; CHECK: Running pass: RequireAnalysisPass
10 ; CHECK-NEXT: Running analysis: DemandedBitsAnalysis on ssub_no_overflow_due_to_or_conds
11 ; CHECK-NEXT: Running analysis: AssumptionAnalysis on ssub_no_overflow_due_to_or_conds
12 ; CHECK-NEXT: Running analysis: TargetIRAnalysis on ssub_no_overflow_due_to_or_conds
13 ; CHECK-NEXT: Running analysis: DominatorTreeAnalysis on ssub_no_overflow_due_to_or_conds
14 ; CHECK-NEXT: Running pass: ConstraintEliminationPass on ssub_no_overflow_due_to_or_conds
15 ; CHECK-NEXT: Running analysis: LoopAnalysis on ssub_no_overflow_due_to_or_conds
16 ; CHECK-NEXT: Running analysis: ScalarEvolutionAnalysis on ssub_no_overflow_due_to_or_conds
17 ; CHECK-NEXT: Running analysis: TargetLibraryAnalysis on ssub_no_overflow_due_to_or_conds
18 ; CHECK-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis on ssub_no_overflow_due_to_or_conds
19 ; CHECK-NEXT: Invalidating analysis: DemandedBitsAnalysis on ssub_no_overflow_due_to_or_conds
20 ; CHECK-NEXT: Running pass: RequireAnalysisPass
21 ; CHECK-NEXT: Running analysis: DemandedBitsAnalysis on ssub_no_overflow_due_to_or_conds
23 ; CHECK-NEXT: Running pass: RequireAnalysisPass
24 ; CHECK-NEXT: Running analysis: DemandedBitsAnalysis on uge_zext
25 ; CHECK-NEXT: Running analysis: AssumptionAnalysis on uge_zext
26 ; CHECK-NEXT: Running analysis: TargetIRAnalysis on uge_zext
27 ; CHECK-NEXT: Running analysis: DominatorTreeAnalysis on uge_zext
28 ; CHECK-NEXT: Running pass: ConstraintEliminationPass on uge_zext
29 ; CHECK-NEXT: Running analysis: LoopAnalysis on uge_zext
30 ; CHECK-NEXT: Running analysis: ScalarEvolutionAnalysis on uge_zext
31 ; CHECK-NEXT: Running analysis: TargetLibraryAnalysis on uge_zext
32 ; CHECK-NEXT: Running analysis: OptimizationRemarkEmitterAnalysis on uge_zext
33 ; CHECK-NEXT: Invalidating analysis: DemandedBitsAnalysis on uge_zext
34 ; CHECK-NEXT: Running pass: RequireAnalysisPass
35 ; CHECK-NEXT: Running analysis: DemandedBitsAnalysis on uge_zext
37 declare { i8, i1 } @llvm.ssub.with.overflow.i8(i8, i8)
39 define i8 @ssub_no_overflow_due_to_or_conds(i8 %a, i8 %b) {
41 %c.1 = icmp sle i8 %b, %a
42 %c.2 = icmp slt i8 %a, 0
43 %or.cond = or i1 %c.2, %c.1
44 br i1 %or.cond, label %exit.fail, label %math
47 %op = tail call { i8, i1 } @llvm.ssub.with.overflow.i8(i8 %b, i8 %a)
48 %status = extractvalue { i8, i1 } %op, 1
49 br i1 %status, label %exit.fail, label %exit.ok
52 %res = extractvalue { i8, i1 } %op, 0
59 declare void @use_res({ i8, i1 })
62 define i1 @uge_zext(i8 %x, i16 %y) {
64 %x.ext = zext i8 %x to i16
65 %c.1 = icmp uge i16 %x.ext, %y
66 br i1 %c.1, label %bb1, label %bb2
69 %t.1 = icmp uge i16 %x.ext, %y
75 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: