Skip to content

Commit

Permalink
[LAA] Add tests with invariant accesses using vector types.
Browse files Browse the repository at this point in the history
Extra tests for llvm#92307
  • Loading branch information
fhahn committed May 20, 2024
1 parent 04ae6e6 commit d108fa0
Showing 1 changed file with 70 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -754,3 +754,73 @@ loop:
exit:
ret void
}

define void @test_invar_vector_dependence_before_positive_strided_access_1(ptr %a) {
; CHECK-LABEL: 'test_invar_vector_dependence_before_positive_strided_access_1'
; CHECK-NEXT: loop:
; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
; CHECK-NEXT: Unknown data dependence.
; CHECK-NEXT: Dependences:
; CHECK-NEXT: Unknown:
; CHECK-NEXT: %l = load <4 x i8>, ptr %a, align 4 ->
; CHECK-NEXT: store i32 0, ptr %gep, align 4
; CHECK-EMPTY:
; CHECK-NEXT: Run-time memory checks:
; CHECK-NEXT: Grouped accesses:
; CHECK-EMPTY:
; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
; CHECK-NEXT: SCEV assumptions:
; CHECK-EMPTY:
; CHECK-NEXT: Expressions re-written:
;
entry:
%gep.off = getelementptr i8, ptr %a, i32 4
br label %loop

loop:
%iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
%gep = getelementptr i32, ptr %gep.off, i32 %iv
%l = load <4 x i8>, ptr %a
store i32 0, ptr %gep
%iv.next = add i32 %iv, 1
%ec = icmp eq i32 %iv.next, 100
br i1 %ec, label %exit, label %loop

exit:
ret void
}

define void @test_invar_scalable_dependence_before_positive_strided_access_1(ptr %a) {
; CHECK-LABEL: 'test_invar_scalable_dependence_before_positive_strided_access_1'
; CHECK-NEXT: loop:
; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
; CHECK-NEXT: Unknown data dependence.
; CHECK-NEXT: Dependences:
; CHECK-NEXT: Unknown:
; CHECK-NEXT: %l = load <vscale x 4 x i8>, ptr %a, align 4 ->
; CHECK-NEXT: store i32 0, ptr %gep, align 4
; CHECK-EMPTY:
; CHECK-NEXT: Run-time memory checks:
; CHECK-NEXT: Grouped accesses:
; CHECK-EMPTY:
; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
; CHECK-NEXT: SCEV assumptions:
; CHECK-EMPTY:
; CHECK-NEXT: Expressions re-written:
;
entry:
%gep.off = getelementptr i8, ptr %a, i32 4
br label %loop

loop:
%iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
%gep = getelementptr i32, ptr %gep.off, i32 %iv
%l = load <vscale x 4 x i8>, ptr %a
store i32 0, ptr %gep
%iv.next = add i32 %iv, 1
%ec = icmp eq i32 %iv.next, 100
br i1 %ec, label %exit, label %loop

exit:
ret void
}

0 comments on commit d108fa0

Please sign in to comment.