Ehsan Amiri | a538b0f | 2016-08-03 18:17:35 +0000 | [diff] [blame] | 1 | ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 < %s | FileCheck %s |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 2 | target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64" |
| 3 | target triple = "powerpc64-unknown-linux-gnu" |
| 4 | |
| 5 | ; Function Attrs: nounwind |
| 6 | define void @foo(float* noalias nocapture %x, float* noalias nocapture readonly %y) #0 { |
| 7 | entry: |
| 8 | br label %vector.body |
| 9 | |
| 10 | vector.body: ; preds = %vector.body, %entry |
| 11 | ; CHECK-LABEL: @foo |
| 12 | ; CHECK: lvsl |
| 13 | ; CHECK: blr |
| 14 | %index = phi i64 [ 0, %entry ], [ %index.next.15, %vector.body ] |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 15 | %0 = getelementptr inbounds float, float* %y, i64 %index |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 16 | %1 = bitcast float* %0 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 17 | %wide.load = load <4 x float>, <4 x float>* %1, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 18 | %2 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 19 | %3 = getelementptr inbounds float, float* %x, i64 %index |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 20 | %4 = bitcast float* %3 to <4 x float>* |
| 21 | store <4 x float> %2, <4 x float>* %4, align 4 |
| 22 | %index.next = add i64 %index, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 23 | %5 = getelementptr inbounds float, float* %y, i64 %index.next |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 24 | %6 = bitcast float* %5 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 25 | %wide.load.1 = load <4 x float>, <4 x float>* %6, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 26 | %7 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.1) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 27 | %8 = getelementptr inbounds float, float* %x, i64 %index.next |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 28 | %9 = bitcast float* %8 to <4 x float>* |
| 29 | store <4 x float> %7, <4 x float>* %9, align 4 |
| 30 | %index.next.1 = add i64 %index.next, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 31 | %10 = getelementptr inbounds float, float* %y, i64 %index.next.1 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 32 | %11 = bitcast float* %10 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 33 | %wide.load.2 = load <4 x float>, <4 x float>* %11, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 34 | %12 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.2) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 35 | %13 = getelementptr inbounds float, float* %x, i64 %index.next.1 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 36 | %14 = bitcast float* %13 to <4 x float>* |
| 37 | store <4 x float> %12, <4 x float>* %14, align 4 |
| 38 | %index.next.2 = add i64 %index.next.1, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 39 | %15 = getelementptr inbounds float, float* %y, i64 %index.next.2 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 40 | %16 = bitcast float* %15 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 41 | %wide.load.3 = load <4 x float>, <4 x float>* %16, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 42 | %17 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.3) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 43 | %18 = getelementptr inbounds float, float* %x, i64 %index.next.2 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 44 | %19 = bitcast float* %18 to <4 x float>* |
| 45 | store <4 x float> %17, <4 x float>* %19, align 4 |
| 46 | %index.next.3 = add i64 %index.next.2, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 47 | %20 = getelementptr inbounds float, float* %y, i64 %index.next.3 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 48 | %21 = bitcast float* %20 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 49 | %wide.load.4 = load <4 x float>, <4 x float>* %21, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 50 | %22 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.4) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 51 | %23 = getelementptr inbounds float, float* %x, i64 %index.next.3 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 52 | %24 = bitcast float* %23 to <4 x float>* |
| 53 | store <4 x float> %22, <4 x float>* %24, align 4 |
| 54 | %index.next.4 = add i64 %index.next.3, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 55 | %25 = getelementptr inbounds float, float* %y, i64 %index.next.4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 56 | %26 = bitcast float* %25 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 57 | %wide.load.5 = load <4 x float>, <4 x float>* %26, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 58 | %27 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.5) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 59 | %28 = getelementptr inbounds float, float* %x, i64 %index.next.4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 60 | %29 = bitcast float* %28 to <4 x float>* |
| 61 | store <4 x float> %27, <4 x float>* %29, align 4 |
| 62 | %index.next.5 = add i64 %index.next.4, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 63 | %30 = getelementptr inbounds float, float* %y, i64 %index.next.5 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 64 | %31 = bitcast float* %30 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 65 | %wide.load.6 = load <4 x float>, <4 x float>* %31, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 66 | %32 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.6) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 67 | %33 = getelementptr inbounds float, float* %x, i64 %index.next.5 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 68 | %34 = bitcast float* %33 to <4 x float>* |
| 69 | store <4 x float> %32, <4 x float>* %34, align 4 |
| 70 | %index.next.6 = add i64 %index.next.5, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 71 | %35 = getelementptr inbounds float, float* %y, i64 %index.next.6 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 72 | %36 = bitcast float* %35 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 73 | %wide.load.7 = load <4 x float>, <4 x float>* %36, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 74 | %37 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.7) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 75 | %38 = getelementptr inbounds float, float* %x, i64 %index.next.6 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 76 | %39 = bitcast float* %38 to <4 x float>* |
| 77 | store <4 x float> %37, <4 x float>* %39, align 4 |
| 78 | %index.next.7 = add i64 %index.next.6, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 79 | %40 = getelementptr inbounds float, float* %y, i64 %index.next.7 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 80 | %41 = bitcast float* %40 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 81 | %wide.load.8 = load <4 x float>, <4 x float>* %41, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 82 | %42 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.8) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 83 | %43 = getelementptr inbounds float, float* %x, i64 %index.next.7 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 84 | %44 = bitcast float* %43 to <4 x float>* |
| 85 | store <4 x float> %42, <4 x float>* %44, align 4 |
| 86 | %index.next.8 = add i64 %index.next.7, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 87 | %45 = getelementptr inbounds float, float* %y, i64 %index.next.8 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 88 | %46 = bitcast float* %45 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 89 | %wide.load.9 = load <4 x float>, <4 x float>* %46, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 90 | %47 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.9) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 91 | %48 = getelementptr inbounds float, float* %x, i64 %index.next.8 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 92 | %49 = bitcast float* %48 to <4 x float>* |
| 93 | store <4 x float> %47, <4 x float>* %49, align 4 |
| 94 | %index.next.9 = add i64 %index.next.8, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 95 | %50 = getelementptr inbounds float, float* %y, i64 %index.next.9 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 96 | %51 = bitcast float* %50 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 97 | %wide.load.10 = load <4 x float>, <4 x float>* %51, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 98 | %52 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.10) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 99 | %53 = getelementptr inbounds float, float* %x, i64 %index.next.9 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 100 | %54 = bitcast float* %53 to <4 x float>* |
| 101 | store <4 x float> %52, <4 x float>* %54, align 4 |
| 102 | %index.next.10 = add i64 %index.next.9, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 103 | %55 = getelementptr inbounds float, float* %y, i64 %index.next.10 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 104 | %56 = bitcast float* %55 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 105 | %wide.load.11 = load <4 x float>, <4 x float>* %56, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 106 | %57 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.11) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 107 | %58 = getelementptr inbounds float, float* %x, i64 %index.next.10 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 108 | %59 = bitcast float* %58 to <4 x float>* |
| 109 | store <4 x float> %57, <4 x float>* %59, align 4 |
| 110 | %index.next.11 = add i64 %index.next.10, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 111 | %60 = getelementptr inbounds float, float* %y, i64 %index.next.11 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 112 | %61 = bitcast float* %60 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 113 | %wide.load.12 = load <4 x float>, <4 x float>* %61, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 114 | %62 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.12) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 115 | %63 = getelementptr inbounds float, float* %x, i64 %index.next.11 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 116 | %64 = bitcast float* %63 to <4 x float>* |
| 117 | store <4 x float> %62, <4 x float>* %64, align 4 |
| 118 | %index.next.12 = add i64 %index.next.11, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 119 | %65 = getelementptr inbounds float, float* %y, i64 %index.next.12 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 120 | %66 = bitcast float* %65 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 121 | %wide.load.13 = load <4 x float>, <4 x float>* %66, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 122 | %67 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.13) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 123 | %68 = getelementptr inbounds float, float* %x, i64 %index.next.12 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 124 | %69 = bitcast float* %68 to <4 x float>* |
| 125 | store <4 x float> %67, <4 x float>* %69, align 4 |
| 126 | %index.next.13 = add i64 %index.next.12, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 127 | %70 = getelementptr inbounds float, float* %y, i64 %index.next.13 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 128 | %71 = bitcast float* %70 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 129 | %wide.load.14 = load <4 x float>, <4 x float>* %71, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 130 | %72 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.14) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 131 | %73 = getelementptr inbounds float, float* %x, i64 %index.next.13 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 132 | %74 = bitcast float* %73 to <4 x float>* |
| 133 | store <4 x float> %72, <4 x float>* %74, align 4 |
| 134 | %index.next.14 = add i64 %index.next.13, 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 135 | %75 = getelementptr inbounds float, float* %y, i64 %index.next.14 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 136 | %76 = bitcast float* %75 to <4 x float>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 137 | %wide.load.15 = load <4 x float>, <4 x float>* %76, align 4 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 138 | %77 = call <4 x float> @llvm_cos_v4f32(<4 x float> %wide.load.15) |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 139 | %78 = getelementptr inbounds float, float* %x, i64 %index.next.14 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 140 | %79 = bitcast float* %78 to <4 x float>* |
| 141 | store <4 x float> %77, <4 x float>* %79, align 4 |
| 142 | %index.next.15 = add i64 %index.next.14, 4 |
| 143 | %80 = icmp eq i64 %index.next.15, 2048 |
| 144 | br i1 %80, label %for.end, label %vector.body |
| 145 | |
| 146 | for.end: ; preds = %vector.body |
| 147 | ret void |
| 148 | } |
| 149 | |
| 150 | ; Function Attrs: nounwind readonly |
| 151 | declare <4 x float> @llvm_cos_v4f32(<4 x float>) #1 |
| 152 | |
| 153 | define <2 x double> @bar(double* %x) { |
| 154 | entry: |
| 155 | %p = bitcast double* %x to <2 x double>* |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 156 | %r = load <2 x double>, <2 x double>* %p, align 8 |
Hal Finkel | 40c3478 | 2013-09-15 22:09:58 +0000 | [diff] [blame] | 157 | |
| 158 | ; CHECK-LABEL: @bar |
| 159 | ; CHECK-NOT: lvsl |
| 160 | ; CHECK: blr |
| 161 | |
| 162 | ret <2 x double> %r |
| 163 | } |
| 164 | |
| 165 | attributes #0 = { nounwind } |
| 166 | attributes #1 = { nounwind readonly } |