1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -S -passes=instcombine < %s | FileCheck %s
4 declare i1 @llvm.is.constant.i32(i32)
6 define void @test(ptr %bpf_prog_calc_tag___trans_tmp_3, i32 %0) {
7 ; CHECK-LABEL: define void @test
8 ; CHECK-SAME: (ptr [[BPF_PROG_CALC_TAG___TRANS_TMP_3:%.*]], i32 [[TMP0:%.*]]) {
10 ; CHECK-NEXT: br i1 true, label [[IF_ELSE_I:%.*]], label [[IF_THEN_I:%.*]]
12 ; CHECK-NEXT: br label [[__FSWAB64_EXIT:%.*]]
14 ; CHECK-NEXT: br label [[__FSWAB64_EXIT]]
15 ; CHECK: __fswab64.exit:
16 ; CHECK-NEXT: store i32 0, ptr [[BPF_PROG_CALC_TAG___TRANS_TMP_3]], align 4
17 ; CHECK-NEXT: ret void
20 %conv = zext i32 %0 to i64
21 %1 = lshr i64 %conv, 32
22 %conv1.i = trunc i64 %1 to i32
23 %2 = call i1 @llvm.is.constant.i32(i32 %conv1.i)
24 br i1 %2, label %if.else.i, label %if.then.i
26 if.then.i: ; preds = %entry
27 %3 = load volatile i32, ptr null, align 2147483648
28 br label %__fswab64.exit
30 if.else.i: ; preds = %entry
31 %or.i = call i32 @llvm.fshl.i32(i32 %conv1.i, i32 0, i32 16)
32 br label %__fswab64.exit
34 __fswab64.exit: ; preds = %if.then.i, %if.else.i
35 %t.0.i = phi i32 [ %or.i, %if.else.i ], [ %3, %if.then.i ]
36 %shr2.i = lshr i32 %t.0.i, 1
37 store i32 %shr2.i, ptr %bpf_prog_calc_tag___trans_tmp_3, align 4
41 declare i32 @llvm.fshl.i32(i32, i32, i32)