brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 45c2ea0 Raw
33 lines · plain
1// RUN: fir-opt --fir-to-llvm-ir %s | FileCheck %s2 3#access_group = #llvm.access_group<id = distinct[0]<>>4// CHECK: #[[ACCESS:.*]] = #llvm.access_group<id = distinct[0]<>>5#loop_vectorize = #llvm.loop_vectorize<disable = false>6// CHECK: #[[VECTORIZE:.*]] = #llvm.loop_vectorize<disable = false>7#loop_annotation = #llvm.loop_annotation<vectorize = #loop_vectorize, parallelAccesses = #access_group>8// CHECK: #[[ANNOTATION:.*]] = #llvm.loop_annotation<vectorize = #[[VECTORIZE]], parallelAccesses = #[[ACCESS]]>9 10func.func @_QPvector_always() -> i32 {11  %c1 = arith.constant 1 : index12  %c10_i32 = arith.constant 10 : i3213  %c1_i32 = arith.constant 1 : i3214  %c10 = arith.constant 10 : index15  %0 = arith.subi %c10, %c1 : index16  %1 = arith.addi %0, %c1 : index17  %2 = arith.divsi %1, %c1 : index18  cf.br ^bb1(%c1, %c1_i32, %2 : index, i32, index)19^bb1(%3: index, %4: i32, %5: index):  // 2 preds: ^bb0, ^bb220  %c0 = arith.constant 0 : index21  %6 = arith.cmpi sgt, %5, %c0 : index22  cf.cond_br %6, ^bb2, ^bb3 {loop_annotation = #loop_annotation}23// CHECK:   llvm.cond_br %{{.*}}, ^{{.*}}, ^{{.*}} {loop_annotation = #[[ANNOTATION]]}24^bb2:  // pred: ^bb125  %7 = arith.addi %3, %c1 : index26  %c1_0 = arith.constant 1 : index27  %8 = arith.subi %5, %c1_0 : index28  cf.br ^bb1(%7, %c1_i32, %8 : index, i32, index)29^bb3:  // pred: ^bb130  return %4 : i3231}32 33