brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 8c0fc61 Raw
58 lines · plain
1; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize,vplan -disable-output -prefer-predicate-over-epilogue=scalar-epilogue 2>&1 < %s | FileCheck %s2; REQUIRES: asserts3 4target triple = "aarch64"5 6; Test that shows how many registers the loop vectorizer thinks an illegal <VF x i1> will consume.7 8; CHECK-LABEL: LV: Checking a loop in 'or_reduction_neon' from <stdin>9; CHECK: LV(REG): VF = 3210; CHECK-NEXT: LV(REG): Found max usage: 2 item11; CHECK-NEXT: LV(REG): RegisterClass: Generic::ScalarRC, 2 registers12; CHECK-NEXT: LV(REG): RegisterClass: Generic::VectorRC, 72 registers13 14define i1 @or_reduction_neon(i32 %arg, ptr %ptr) {15entry:16  br label %loop17exit:18  ret i1 %reduction_next19loop:20  %induction = phi i32 [ 0, %entry ], [ %induction_next, %loop ]21  %reduction = phi i1 [ 0, %entry ], [ %reduction_next, %loop ]22  %gep = getelementptr inbounds i32, ptr %ptr, i32 %induction23  %loaded = load i32, ptr %gep24  %i1 = icmp eq i32 %loaded, %induction25  %reduction_next = or i1 %i1, %reduction26  %induction_next = add nuw i32 %induction, 127  %cond = icmp eq i32 %induction_next, %arg28  br i1 %cond, label %exit, label %loop, !llvm.loop !3229}30 31; CHECK-LABEL: LV: Checking a loop in 'or_reduction_sve'32; CHECK: LV(REG): VF = 6433; CHECK-NEXT: LV(REG): Found max usage: 2 item34; CHECK-NEXT: LV(REG): RegisterClass: Generic::ScalarRC, 2 registers35; CHECK-NEXT: LV(REG): RegisterClass: Generic::VectorRC, 136 registers36 37define i1 @or_reduction_sve(i32 %arg, ptr %ptr) vscale_range(2,2) "target-features"="+sve" {38entry:39  br label %loop40exit:41  ret i1 %reduction_next42loop:43  %induction = phi i32 [ 0, %entry ], [ %induction_next, %loop ]44  %reduction = phi i1 [ true, %entry ], [ %reduction_next, %loop ]45  %gep = getelementptr inbounds i32, ptr %ptr, i32 %induction46  %loaded = load i32, ptr %gep47  %i1 = icmp eq i32 %loaded, %induction48  %reduction_next = or i1 %i1, %reduction49  %induction_next = add nuw i32 %induction, 150  %cond = icmp eq i32 %induction_next, %arg51  br i1 %cond, label %exit, label %loop, !llvm.loop !6452}53 54!32 = distinct !{!32, !33}55!33 = !{!"llvm.loop.vectorize.width", i32 32}56!64 = distinct !{!64, !65}57!65 = !{!"llvm.loop.vectorize.width", i32 64}58