Jonas Paulsson | 9222b91 | 2018-01-10 09:33:00 +0000 | [diff] [blame] | 1 | ; Test that selection of Vector Load Element instructions work in the presence of prefetches. |
| 2 | ; |
| 3 | ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s |
| 4 | |
| 5 | ; CHECK-LABEL: .LBB0_1: |
| 6 | ; CHECK-NOT: l %r |
| 7 | ; CHECK-NOT: vlvgf |
| 8 | ; CHECK: pfd |
| 9 | ; CHECK: vlef |
| 10 | |
| 11 | %type0 = type { i32, [400 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } |
| 12 | @Mem = external global [150 x %type0], align 4 |
| 13 | |
| 14 | define void @fun() local_unnamed_addr #0 { |
| 15 | entry: |
| 16 | br label %vector.body |
| 17 | |
| 18 | vector.body: ; preds = %vector.body, %entry |
| 19 | %index = phi i64 [ 0, %entry ], [ %index.next.3, %vector.body ] |
| 20 | %vec.phi = phi <4 x i32> [ zeroinitializer, %entry ], [ %57, %vector.body ] |
| 21 | %0 = or i64 %index, 2 |
| 22 | %1 = or i64 %index, 3 |
| 23 | %2 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 0, i32 3 |
| 24 | %3 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 %0, i32 3 |
| 25 | %4 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 %1, i32 3 |
| 26 | %5 = load i32, i32* null, align 4 |
| 27 | %6 = load i32, i32* %3, align 4 |
| 28 | %7 = load i32, i32* %4, align 4 |
| 29 | %8 = insertelement <4 x i32> undef, i32 %5, i32 0 |
| 30 | %9 = insertelement <4 x i32> %8, i32 0, i32 1 |
| 31 | %10 = insertelement <4 x i32> %9, i32 %6, i32 2 |
| 32 | %11 = insertelement <4 x i32> %10, i32 %7, i32 3 |
| 33 | %12 = add nsw <4 x i32> %11, %vec.phi |
| 34 | %13 = or i64 %index, 7 |
| 35 | %14 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 undef, i32 3 |
| 36 | %15 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 0, i32 3 |
| 37 | %16 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 %13, i32 3 |
| 38 | %17 = load i32, i32* %14, align 4 |
| 39 | %18 = load i32, i32* undef, align 4 |
| 40 | %19 = load i32, i32* %15, align 4 |
| 41 | %20 = load i32, i32* %16, align 4 |
| 42 | %21 = insertelement <4 x i32> undef, i32 %17, i32 0 |
| 43 | %22 = insertelement <4 x i32> %21, i32 %18, i32 1 |
| 44 | %23 = insertelement <4 x i32> %22, i32 %19, i32 2 |
| 45 | %24 = insertelement <4 x i32> %23, i32 %20, i32 3 |
| 46 | %25 = add nsw <4 x i32> %24, %12 |
| 47 | %26 = or i64 %index, 9 |
| 48 | %27 = or i64 %index, 10 |
| 49 | %28 = or i64 %index, 11 |
| 50 | %29 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 undef, i32 3 |
| 51 | %30 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 %26, i32 3 |
| 52 | %31 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 %27, i32 3 |
| 53 | %32 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 %28, i32 3 |
| 54 | %33 = load i32, i32* %29, align 4 |
| 55 | %34 = load i32, i32* %30, align 4 |
| 56 | %35 = load i32, i32* %31, align 4 |
| 57 | %36 = load i32, i32* %32, align 4 |
| 58 | %37 = insertelement <4 x i32> undef, i32 %33, i32 0 |
| 59 | %38 = insertelement <4 x i32> %37, i32 %34, i32 1 |
| 60 | %39 = insertelement <4 x i32> %38, i32 %35, i32 2 |
| 61 | %40 = insertelement <4 x i32> %39, i32 %36, i32 3 |
| 62 | %41 = add nsw <4 x i32> %40, %25 |
| 63 | %42 = or i64 %index, 13 |
| 64 | %43 = or i64 %index, 14 |
| 65 | %44 = or i64 %index, 15 |
| 66 | %45 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 undef, i32 3 |
| 67 | %46 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 %42, i32 3 |
| 68 | %47 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 %43, i32 3 |
| 69 | %48 = getelementptr inbounds [150 x %type0], [150 x %type0]* @Mem, i64 0, i64 %44, i32 3 |
| 70 | %49 = load i32, i32* %45, align 4 |
| 71 | %50 = load i32, i32* %46, align 4 |
| 72 | %51 = load i32, i32* %47, align 4 |
| 73 | %52 = load i32, i32* %48, align 4 |
| 74 | %53 = insertelement <4 x i32> undef, i32 %49, i32 0 |
| 75 | %54 = insertelement <4 x i32> %53, i32 %50, i32 1 |
| 76 | %55 = insertelement <4 x i32> %54, i32 %51, i32 2 |
| 77 | %56 = insertelement <4 x i32> %55, i32 %52, i32 3 |
| 78 | %57 = add nsw <4 x i32> %56, %41 |
| 79 | %index.next.3 = add i64 %index, 16 |
| 80 | br i1 false, label %middle.block.unr-lcssa, label %vector.body |
| 81 | |
| 82 | middle.block.unr-lcssa: ; preds = %vector.body |
| 83 | %rdx.shuf = shufflevector <4 x i32> %57, <4 x i32> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 undef> |
| 84 | unreachable |
| 85 | } |
| 86 | |