33 lines · plain
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 %t2; RUN: FileCheck --check-prefixes=CHECK %s < %t3 4; Make sure if we're replacing the value in a phi, it's replaced for5; all repeats of the same incoming block.6 7; CHECK-INTERESTINGNESS: switch8; CHECK-INTERESTINGNESS: phi9; CHECK-INTERESTINGNESS-SAME: [ %gep1, %bb1 ]10 11; CHECK: %phi.ptr = phi ptr [ %arg1, %entry ], [ %arg1, %entry ], [ %gep1, %bb1 ]12define void @foo(i32 %arg0, ptr %arg1, ptr %arg2) {13entry:14 %gep0 = getelementptr i32, ptr %arg1, i32 1015 %gep1 = getelementptr i32, ptr %arg2, i32 1216 switch i32 %arg0, label %ret [17 i32 3, label %bb118 i32 4, label %bb219 i32 12, label %bb220 ]21 22bb1:23 br label %bb224 25bb2:26 %phi.ptr = phi ptr [ %gep0, %entry ], [ %gep0, %entry ], [ %gep1, %bb1 ]27 store volatile i32 0, ptr %phi.ptr28 br label %ret29 30ret:31 ret void32}33