1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -slp-vectorizer -S -mtriple=i386-pc-linux | FileCheck %s
4 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"
5 target triple = "i386-pc-linux"
7 ; Function Attrs: nounwind
8 define i32 @_Z16adjustFixupValueyj(i64 %Value, i32 %Kind) {
9 ; CHECK-LABEL: @_Z16adjustFixupValueyj(
11 ; CHECK-NEXT: [[EXTRACT_T:%.*]] = trunc i64 [[VALUE:%.*]] to i32
12 ; CHECK-NEXT: [[EXTRACT:%.*]] = lshr i64 [[VALUE]], 12
13 ; CHECK-NEXT: [[EXTRACT_T6:%.*]] = trunc i64 [[EXTRACT]] to i32
14 ; CHECK-NEXT: switch i32 [[KIND:%.*]], label [[SW_DEFAULT:%.*]] [
15 ; CHECK-NEXT: i32 0, label [[RETURN:%.*]]
16 ; CHECK-NEXT: i32 1, label [[RETURN]]
17 ; CHECK-NEXT: i32 129, label [[SW_BB1:%.*]]
18 ; CHECK-NEXT: i32 130, label [[SW_BB2:%.*]]
21 ; CHECK-NEXT: call void @_Z25llvm_unreachable_internalv()
22 ; CHECK-NEXT: unreachable
24 ; CHECK-NEXT: [[SHR:%.*]] = lshr i64 [[VALUE]], 16
25 ; CHECK-NEXT: [[EXTRACT_T5:%.*]] = trunc i64 [[SHR]] to i32
26 ; CHECK-NEXT: [[EXTRACT7:%.*]] = lshr i64 [[VALUE]], 28
27 ; CHECK-NEXT: [[EXTRACT_T8:%.*]] = trunc i64 [[EXTRACT7]] to i32
28 ; CHECK-NEXT: br label [[SW_BB2]]
30 ; CHECK-NEXT: [[VALUE_ADDR_0_OFF0:%.*]] = phi i32 [ [[EXTRACT_T]], [[ENTRY:%.*]] ], [ [[EXTRACT_T5]], [[SW_BB1]] ]
31 ; CHECK-NEXT: [[VALUE_ADDR_0_OFF12:%.*]] = phi i32 [ [[EXTRACT_T6]], [[ENTRY]] ], [ [[EXTRACT_T8]], [[SW_BB1]] ]
32 ; CHECK-NEXT: [[CONV6:%.*]] = and i32 [[VALUE_ADDR_0_OFF0]], 4095
33 ; CHECK-NEXT: [[CONV4:%.*]] = shl i32 [[VALUE_ADDR_0_OFF12]], 16
34 ; CHECK-NEXT: [[SHL:%.*]] = and i32 [[CONV4]], 983040
35 ; CHECK-NEXT: [[OR:%.*]] = or i32 [[SHL]], [[CONV6]]
36 ; CHECK-NEXT: [[OR11:%.*]] = or i32 [[OR]], 8388608
37 ; CHECK-NEXT: br label [[RETURN]]
39 ; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32 [ [[OR11]], [[SW_BB2]] ], [ [[EXTRACT_T]], [[ENTRY]] ], [ [[EXTRACT_T]], [[ENTRY]] ]
40 ; CHECK-NEXT: ret i32 [[RETVAL_0]]
43 %extract.t = trunc i64 %Value to i32
44 %extract = lshr i64 %Value, 12
45 %extract.t6 = trunc i64 %extract to i32
46 switch i32 %Kind, label %sw.default [
49 i32 129, label %sw.bb1
50 i32 130, label %sw.bb2
53 sw.default: ; preds = %entry
54 call void @_Z25llvm_unreachable_internalv()
57 sw.bb1: ; preds = %entry
58 %shr = lshr i64 %Value, 16
59 %extract.t5 = trunc i64 %shr to i32
60 %extract7 = lshr i64 %Value, 28
61 %extract.t8 = trunc i64 %extract7 to i32
64 sw.bb2: ; preds = %sw.bb1, %entry
65 %Value.addr.0.off0 = phi i32 [ %extract.t, %entry ], [ %extract.t5, %sw.bb1 ]
66 %Value.addr.0.off12 = phi i32 [ %extract.t6, %entry ], [ %extract.t8, %sw.bb1 ]
67 %conv6 = and i32 %Value.addr.0.off0, 4095
68 %conv4 = shl i32 %Value.addr.0.off12, 16
69 %shl = and i32 %conv4, 983040
70 %or = or i32 %shl, %conv6
71 %or11 = or i32 %or, 8388608
74 return: ; preds = %sw.bb2, %entry, %entry
75 %retval.0 = phi i32 [ %or11, %sw.bb2 ], [ %extract.t, %entry ], [ %extract.t, %entry ]
79 ; Function Attrs: noreturn
80 declare void @_Z25llvm_unreachable_internalv()