|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4 |
| 2 | +; RUN: opt < %s -passes="default<O3>" -mcpu=skx -S | FileCheck %s |
| 3 | + |
| 4 | +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" |
| 5 | +target triple = "x86_64-unknown-linux-gnu" |
| 6 | + |
| 7 | +define void @foo(ptr noalias noundef %0, ptr noalias noundef %1) optsize { |
| 8 | +; CHECK-LABEL: define void @foo( |
| 9 | +; CHECK-SAME: ptr noalias nocapture noundef readonly [[TMP0:%.*]], ptr noalias nocapture noundef writeonly [[TMP1:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { |
| 10 | +; CHECK-NEXT: vector.ph: |
| 11 | +; CHECK-NEXT: br label [[TMP4:%.*]] |
| 12 | +; CHECK: vector.body: |
| 13 | +; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, [[TMP2:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[TMP4]] ] |
| 14 | +; CHECK-NEXT: [[VEC_IND:%.*]] = phi <8 x i64> [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7>, [[TMP2]] ], [ [[VEC_IND_NEXT:%.*]], [[TMP4]] ] |
| 15 | +; CHECK-NEXT: [[TMP6:%.*]] = and <8 x i64> [[VEC_IND]], <i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295, i64 4294967295> |
| 16 | +; CHECK-NEXT: [[TMP3:%.*]] = xor <8 x i64> [[TMP6]], <i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255> |
| 17 | +; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds i32, ptr [[TMP0]], <8 x i64> [[TMP3]] |
| 18 | +; CHECK-NEXT: [[WIDE_MASKED_GATHER:%.*]] = tail call <8 x i32> @llvm.masked.gather.v8i32.v8p0(<8 x ptr> [[TMP7]], i32 4, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x i32> poison) |
| 19 | +; CHECK-NEXT: [[TMP5:%.*]] = add nsw <8 x i32> [[WIDE_MASKED_GATHER]], <i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5> |
| 20 | +; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 [[INDVARS_IV]] |
| 21 | +; CHECK-NEXT: store <8 x i32> [[TMP5]], ptr [[TMP10]], align 4 |
| 22 | +; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw i64 [[INDVARS_IV]], 8 |
| 23 | +; CHECK-NEXT: [[VEC_IND_NEXT]] = add <8 x i64> [[VEC_IND]], <i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8, i64 8> |
| 24 | +; CHECK-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i64 [[INDVARS_IV_NEXT]], 256 |
| 25 | +; CHECK-NEXT: br i1 [[EXITCOND_NOT]], label [[MIDDLE_BLOCK:%.*]], label [[TMP4]], !llvm.loop [[LOOP0:![0-9]+]] |
| 26 | +; CHECK: middle.block: |
| 27 | +; CHECK-NEXT: ret void |
| 28 | +; |
| 29 | + br label %3 |
| 30 | + |
| 31 | +3: ; preds = %7, %2 |
| 32 | + %4 = phi i32 [ 0, %2 ], [ %15, %7 ] |
| 33 | + %5 = icmp slt i32 %4, 256 |
| 34 | + br i1 %5, label %7, label %6 |
| 35 | + |
| 36 | +6: ; preds = %3 |
| 37 | + ret void |
| 38 | + |
| 39 | +7: ; preds = %3 |
| 40 | + %8 = sub nsw i32 255, %4 |
| 41 | + %9 = zext nneg i32 %8 to i64 |
| 42 | + %10 = getelementptr inbounds i32, ptr %0, i64 %9 |
| 43 | + %11 = load i32, ptr %10, align 4 |
| 44 | + %12 = add nsw i32 %11, 5 |
| 45 | + %13 = sext i32 %4 to i64 |
| 46 | + %14 = getelementptr inbounds i32, ptr %1, i64 %13 |
| 47 | + store i32 %12, ptr %14, align 4 |
| 48 | + %15 = add nsw i32 %4, 1 |
| 49 | + br label %3 |
| 50 | +} |
| 51 | +;. |
| 52 | +; CHECK: [[LOOP0]] = distinct !{[[LOOP0]], [[META1:![0-9]+]], [[META2:![0-9]+]]} |
| 53 | +; CHECK: [[META1]] = !{!"llvm.loop.isvectorized", i32 1} |
| 54 | +; CHECK: [[META2]] = !{!"llvm.loop.unroll.runtime.disable"} |
| 55 | +;. |
0 commit comments