1 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=operands-skip --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
2 ; RUN: FileCheck --check-prefixes=CHECK %s < %t
4 ; Make sure if we're replacing the value in a phi, it's replaced for
5 ; all repeats of the same incoming block.
7 ; CHECK-INTERESTINGNESS: switch
8 ; CHECK-INTERESTINGNESS: phi
9 ; CHECK-INTERESTINGNESS-SAME: [ %gep1, %bb1 ]
11 ; CHECK: %phi.ptr = phi ptr [ %arg1, %entry ], [ %arg1, %entry ], [ %gep1, %bb1 ]
12 define void @foo(i32 %arg0, ptr %arg1, ptr %arg2) {
14 %gep0 = getelementptr i32, ptr %arg1, i32 10
15 %gep1 = getelementptr i32, ptr %arg2, i32 12
16 switch i32 %arg0, label %ret [
26 %phi.ptr = phi ptr [ %gep0, %entry ], [ %gep0, %entry ], [ %gep1, %bb1 ]
27 store volatile i32 0, ptr %phi.ptr