1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instsimplify -S | FileCheck %s
5 define i1 @test1(i32 %x) {
7 ; CHECK-NEXT: br i1 true, label [[A:%.*]], label [[B:%.*]]
9 ; CHECK-NEXT: [[AA:%.*]] = or i32 [[X:%.*]], 10
10 ; CHECK-NEXT: br label [[C:%.*]]
12 ; CHECK-NEXT: [[BB:%.*]] = or i32 [[X]], 10
13 ; CHECK-NEXT: br label [[C]]
15 ; CHECK-NEXT: [[CC:%.*]] = phi i32 [ [[BB]], [[B]] ], [ [[AA]], [[A]] ]
16 ; CHECK-NEXT: [[D:%.*]] = urem i32 [[CC]], 2
17 ; CHECK-NEXT: [[E:%.*]] = icmp eq i32 [[D]], 0
18 ; CHECK-NEXT: ret i1 [[E]]
20 br i1 true, label %a, label %b
31 %cc = phi i32 [ %bb, %b ], [%aa, %a ]
33 %e = icmp eq i32 %d, 0
37 ; D63489 - https://reviews.llvm.org/D63489
38 ; If this single-value phi form needs to be preserved to enable
39 ; further analysis, then -instsimplify should not be running?
41 define i32 @lcssa-phi(i32 %x) {
42 ; CHECK-LABEL: @lcssa-phi(
44 ; CHECK-NEXT: br label [[END:%.*]]
46 ; CHECK-NEXT: ret i32 [[X:%.*]]
52 %counter.lcssa = phi i32 [ %x, %entry ]
53 ret i32 %counter.lcssa