[llvm] [LAA] Improve convergent tests (PR #136758)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 28 13:51:10 PDT 2025


================
@@ -1,41 +1,52 @@
-; RUN: opt -passes='print<access-info>' -disable-output  < %s 2>&1 | FileCheck %s
+; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -passes='print<access-info>' -disable-output %s 2>&1 | FileCheck %s
 
 ; Analyze this loop:
 ;   for (i = 0; i < n; i++)
 ;    A[i + 1] = A[i] * B[i] * C[i];
 
-target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
-
-; CHECK: for.body:
-; CHECK: Has convergent operation in loop
-; CHECK: Report: cannot add control dependency to convergent operation
-; CHECK-NEXT: Dependences:
-; CHECK-NEXT:   Backward:
-; CHECK-NEXT:     %loadA = load i16, ptr %arrayidxA, align 2 ->
-; CHECK-NEXT:     store i16 %mul1, ptr %arrayidxA_plus_2, align 2
-; CHECK: Run-time memory checks:
-; CHECK-NEXT: 0:
-; CHECK-NEXT: Comparing group
-; CHECK-NEXT:   %arrayidxA = getelementptr inbounds i16, ptr %a, i64 %storemerge3
-; CHECK-NEXT:   %arrayidxA_plus_2 = getelementptr inbounds i16, ptr %a, i64 %add
-; CHECK-NEXT: Against group
-; CHECK-NEXT:   %arrayidxB = getelementptr inbounds i16, ptr %b, i64 %storemerge3
-; CHECK-NEXT: 1:
-; CHECK-NEXT: Comparing group
-; CHECK-NEXT:   %arrayidxA = getelementptr inbounds i16, ptr %a, i64 %storemerge3
-; CHECK-NEXT:   %arrayidxA_plus_2 = getelementptr inbounds i16, ptr %a, i64 %add
-; CHECK-NEXT: Against group
-; CHECK-NEXT:   %arrayidxC = getelementptr inbounds i16, ptr %c, i64 %storemerge3
-
- at B = common global ptr null, align 8
- at A = common global ptr null, align 8
- at C = common global ptr null, align 8
-
-define void @f() #1 {
+; In this case, runtime checks are suggested, and there is a convergent operation.
----------------
fhahn wrote:

```suggestion
; In this case, runtime checks are needed, and there is a convergent operation.
```
runtime checks needed instead of suggested, also consistent with below?

https://github.com/llvm/llvm-project/pull/136758


More information about the llvm-commits mailing list