|
| 1 | +; RUN: opt -S -mtriple=aarch64-unknown-linux-gnu -O2 < %s | FileCheck %s |
| 2 | + |
| 3 | +; Function Attrs: nofree nosync nounwind readnone uwtable vscale_range(1,16) |
| 4 | +define dso_local i32 @testInstCombineSVECmpNE() local_unnamed_addr #0 { |
| 5 | +entry: |
| 6 | + %0 = tail call <vscale x 16 x i8> @llvm.aarch64.sve.index.nxv16i8(i8 42, i8 1) |
| 7 | + %1 = tail call <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 31) |
| 8 | + br label %for.body |
| 9 | + |
| 10 | +for.cond.cleanup: ; preds = %for.inc |
| 11 | + %2 = tail call i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1> %1, <vscale x 16 x i1> %cmp_rslt.1) |
| 12 | + %not. = xor i1 %2, true |
| 13 | + %. = zext i1 %not. to i32 |
| 14 | + ret i32 %. |
| 15 | + |
| 16 | +for.body: ; preds = %entry, %for.inc |
| 17 | + %i.010 = phi i64 [ 0, %entry ], [ %inc, %for.inc ] |
| 18 | + %cmp1 = icmp ugt i64 %i.010, 32 |
| 19 | + %3 = tail call <vscale x 16 x i8> @llvm.aarch64.sve.dupq.lane.nxv16i8(<vscale x 16 x i8> %0, i64 %i.010) |
| 20 | + br i1 %cmp1, label %if.then, label %if.else |
| 21 | + |
| 22 | +if.then: ; preds = %for.body |
| 23 | + %4 = tail call <vscale x 16 x i1> @llvm.aarch64.sve.cmpne.nxv16i8(<vscale x 16 x i1> %1, <vscale x 16 x i8> %3, <vscale x 16 x i8> zeroinitializer) |
| 24 | + br label %for.inc |
| 25 | + ; CHECK: %4 = tail call <vscale x 16 x i1> @llvm.aarch64.sve.cmpne.nxv16i8(<vscale x 16 x i1> %1, <vscale x 16 x i8> %3, <vscale x 16 x i8> zeroinitializer) |
| 26 | + ; CHECK-NEXT: br label %for.inc |
| 27 | + |
| 28 | +if.else: ; preds = %for.body |
| 29 | + %5 = tail call <vscale x 16 x i1> @llvm.aarch64.sve.cmpne.nxv16i8(<vscale x 16 x i1> %1, <vscale x 16 x i8> %3, <vscale x 16 x i8> shufflevector (<vscale x 16 x i8> insertelement (<vscale x 16 x i8> poison, i8 1, i32 0), <vscale x 16 x i8> poison, <vscale x 16 x i32> zeroinitializer)) |
| 30 | + br label %for.inc |
| 31 | + |
| 32 | +for.inc: ; preds = %if.then, %if.else |
| 33 | + %cmp_rslt.1 = phi <vscale x 16 x i1> [ %4, %if.then ], [ %5, %if.else ] |
| 34 | + %inc = add nuw nsw i64 %i.010, 1 |
| 35 | + %exitcond.not = icmp eq i64 %inc, 63 |
| 36 | + br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !6 |
| 37 | +} |
| 38 | + |
| 39 | +; Function Attrs: mustprogress nocallback nofree nosync nounwind readnone willreturn |
| 40 | +declare <vscale x 16 x i8> @llvm.aarch64.sve.index.nxv16i8(i8, i8) #1 |
| 41 | + |
| 42 | +; Function Attrs: mustprogress nocallback nofree nosync nounwind readnone willreturn |
| 43 | +declare <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 immarg) #1 |
| 44 | + |
| 45 | +; Function Attrs: mustprogress nocallback nofree nosync nounwind readnone willreturn |
| 46 | +declare <vscale x 16 x i8> @llvm.aarch64.sve.dupq.lane.nxv16i8(<vscale x 16 x i8>, i64) #1 |
| 47 | + |
| 48 | +; Function Attrs: mustprogress nocallback nofree nosync nounwind readnone willreturn |
| 49 | +declare <vscale x 16 x i1> @llvm.aarch64.sve.cmpne.nxv16i8(<vscale x 16 x i1>, <vscale x 16 x i8>, <vscale x 16 x i8>) #1 |
| 50 | + |
| 51 | +; Function Attrs: mustprogress nocallback nofree nosync nounwind readnone willreturn |
| 52 | +declare i1 @llvm.aarch64.sve.ptest.any.nxv16i1(<vscale x 16 x i1>, <vscale x 16 x i1>) #1 |
| 53 | + |
| 54 | +attributes #0 = { nofree nosync nounwind readnone uwtable vscale_range(1,16) "frame-pointer"="non-leaf" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+neon,+sve,+v8.2a" } |
| 55 | +attributes #1 = { mustprogress nocallback nofree nosync nounwind readnone willreturn } |
| 56 | + |
| 57 | +!6 = distinct !{!6, !7} |
| 58 | +!7 = !{!"llvm.loop.mustprogress"} |
0 commit comments