1; RUN: opt -passes=loop-load-elim -mtriple=aarch64 -mattr=+sve -S -debug < %s 2>&1 | FileCheck %s 2; REQUIRES: asserts 3 4; Regression tests verifying "assumption that TypeSize is not scalable" and 5; "Invalid size request on a scalable vector." are not produced by 6; -load-loop-elim (this would cause the test to fail because opt would exit with 7; a non-zero exit status). 8 9; No output checked for this one, but causes a fatal error if the regression is present. 10 11define void @regression_test_get_gep_induction_operand_typesize_warning(i64 %n, ptr %a) { 12entry: 13 br label %loop.body 14 15loop.body: 16 %0 = phi i64 [ 0, %entry ], [ %1, %loop.body ] 17 %idx = getelementptr <vscale x 4 x i32>, ptr %a, i64 %0 18 store <vscale x 4 x i32> zeroinitializer, ptr %idx 19 %1 = add i64 %0, 1 20 %2 = icmp eq i64 %1, %n 21 br i1 %2, label %loop.end, label %loop.body 22 23loop.end: 24 ret void 25} 26 27; CHECK-LABEL: 'regression_test_loop_access_scalable_typesize' 28; CHECK: LAA: Found an analyzable loop: vector.body 29; CHECK: LAA: Bad stride - Scalable object: 30define void @regression_test_loop_access_scalable_typesize(ptr %input_ptr) { 31entry: 32 br label %vector.body 33vector.body: 34 %ind_ptr = phi ptr [ %next_ptr, %vector.body ], [ %input_ptr, %entry ] 35 %ind = phi i64 [ %next, %vector.body ], [ 0, %entry ] 36 %ld = load <vscale x 16 x i8>, ptr %ind_ptr, align 16 37 store <vscale x 16 x i8> zeroinitializer, ptr %ind_ptr, align 16 38 %next_ptr = getelementptr inbounds <vscale x 16 x i8>, ptr %ind_ptr, i64 1 39 %next = add i64 %ind, 1 40 %cond = icmp ult i64 %next, 1024 41 br i1 %cond, label %end, label %vector.body 42end: 43 ret void 44} 45 46; CHECK-LABEL: 'regression_test_loop_access_scalable_typesize_nonscalable_object' 47; CHECK: LAA: Found an analyzable loop: vector.body 48; CHECK: LAA: Bad stride - Scalable object: 49define void @regression_test_loop_access_scalable_typesize_nonscalable_object(ptr %input_ptr) { 50entry: 51 br label %vector.body 52vector.body: 53 %ind_ptr = phi ptr [ %next_ptr, %vector.body ], [ %input_ptr, %entry ] 54 %ind = phi i64 [ %next, %vector.body ], [ 0, %entry ] 55 %ld = load <vscale x 16 x i8>, ptr %ind_ptr, align 16 56 store <vscale x 16 x i8> zeroinitializer, ptr %ind_ptr, align 16 57 %next_ptr = getelementptr inbounds i8, ptr %ind_ptr, i64 1 58 %next = add i64 %ind, 1 59 %cond = icmp ult i64 %next, 1024 60 br i1 %cond, label %end, label %vector.body 61end: 62 ret void 63} 64