| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py |
| ; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s |
| ; Check that simplifycfg deletes a dead 'seteq' instruction when it |
| ; folds a conditional branch into a switch instruction. |
| define void @testcfg(i32 %V) { |
| ; CHECK-NEXT: [[V_OFF:%.*]] = add i32 [[V:%.*]], -15 |
| ; CHECK-NEXT: [[SWITCH:%.*]] = icmp ult i32 [[V_OFF]], 2 |
| ; CHECK-NEXT: br i1 [[SWITCH]], label [[L2:%.*]], label [[L1:%.*]] |
| ; CHECK-NEXT: call void @foo() |
| ; CHECK-NEXT: br label [[COMMON_RET:%.*]] |
| ; CHECK-NEXT: call void @bar() |
| ; CHECK-NEXT: br label [[COMMON_RET]] |
| br i1 %E, label %L1, label %Sw |
| switch i32 %V, label %L1 [ |