From 77a06a9c33a6731fbe800ffaf8ca398bbe00dcba Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Sun, 15 Aug 2021 19:02:32 +0300 Subject: [PATCH] [NFC][SimplifyCFG] Autogenerate check lines in a test to declutter further update --- .../SimplifyCFG/fold-branch-to-common-dest.ll | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll b/llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll index 0dae0e8..2ff0418 100644 --- a/llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll +++ b/llvm/test/Transforms/SimplifyCFG/fold-branch-to-common-dest.ll @@ -134,6 +134,7 @@ define void @one_pred_with_spec_call(i8 %v0, i8 %v1, i32* %p) { ; CHECK: final_right: ; CHECK-NEXT: call void @sideeffect0() ; CHECK-NEXT: br label [[COMMON_RET]] +; pred: %c0 = icmp ne i32* %p, null br i1 %c0, label %dispatch, label %final_right @@ -153,10 +154,19 @@ final_right: ; Drop dereferenceable on the parameter define void @one_pred_with_spec_call_deref(i8 %v0, i8 %v1, i32* %p) { -; CHECK-LABEL: one_pred_with_spec_call_deref -; CHECK-LABEL: pred: -; CHECK: %c0 = icmp ne i32* %p, null -; CHECK: %x = call i32 @speculate_call(i32* %p) +; CHECK-LABEL: @one_pred_with_spec_call_deref( +; CHECK-NEXT: pred: +; CHECK-NEXT: [[C0:%.*]] = icmp ne i32* [[P:%.*]], null +; CHECK-NEXT: [[X:%.*]] = call i32 @speculate_call(i32* [[P]]) +; CHECK-NEXT: [[C1:%.*]] = icmp eq i8 [[V1:%.*]], 0 +; CHECK-NEXT: [[OR_COND:%.*]] = select i1 [[C0]], i1 [[C1]], i1 false +; CHECK-NEXT: br i1 [[OR_COND]], label [[COMMON_RET:%.*]], label [[FINAL_RIGHT:%.*]] +; CHECK: common.ret: +; CHECK-NEXT: ret void +; CHECK: final_right: +; CHECK-NEXT: call void @sideeffect0() +; CHECK-NEXT: br label [[COMMON_RET]] +; pred: %c0 = icmp ne i32* %p, null br i1 %c0, label %dispatch, label %final_right -- 2.7.4