brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 46e81cd Raw
83 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 42; RUN: opt -passes='print<access-info>' -disable-output  < %s 2>&1 | FileCheck %s3 4target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"5 6; void vectorizable_Read_Write(int *A) {7;  for (unsigned i = 1022; i >= 0; i--)8;    A[i+1] = A[i] + 1;9; }10 11define void @vectorizable_Read_Write(ptr nocapture %A) {12; CHECK-LABEL: 'vectorizable_Read_Write'13; CHECK-NEXT:    loop:14; CHECK-NEXT:      Memory dependences are safe15; CHECK-NEXT:      Dependences:16; CHECK-NEXT:        Forward:17; CHECK-NEXT:            %l = load i32, ptr %gep.A, align 4 ->18; CHECK-NEXT:            store i32 %add, ptr %gep.A.plus.1, align 419; CHECK-EMPTY:20; CHECK-NEXT:      Run-time memory checks:21; CHECK-NEXT:      Grouped accesses:22; CHECK-EMPTY:23; CHECK-NEXT:      Non vectorizable stores to invariant address were not found in loop.24; CHECK-NEXT:      SCEV assumptions:25; CHECK-EMPTY:26; CHECK-NEXT:      Expressions re-written:27;28entry:29  %A.plus.1 = getelementptr i32, ptr %A, i64 130  br label %loop31 32loop:33  %iv = phi i64 [ 1022, %entry ], [ %iv.next, %loop ]34  %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv35  %l = load i32, ptr %gep.A, align 436  %add = add nsw i32 %l, 137  %gep.A.plus.1 = getelementptr i32, ptr %A.plus.1, i64 %iv38  store i32 %add, ptr %gep.A.plus.1, align 439  %iv.next = add nsw i64 %iv, -140  %cmp.not = icmp eq i64 %iv, 041  br i1 %cmp.not, label %exit, label %loop42 43exit:44  ret void45}46 47define void @neg_step_ForwardButPreventsForwarding(ptr nocapture %A, ptr noalias %B) {48; CHECK-LABEL: 'neg_step_ForwardButPreventsForwarding'49; CHECK-NEXT:    loop:50; 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 loop51; CHECK-NEXT:  Forward loop carried data dependence that prevents store-to-load forwarding.52; CHECK-NEXT:      Dependences:53; CHECK-NEXT:        ForwardButPreventsForwarding:54; CHECK-NEXT:            store i32 0, ptr %gep.A, align 4 ->55; CHECK-NEXT:            %l = load i32, ptr %gep.A.plus.1, align 456; CHECK-EMPTY:57; CHECK-NEXT:      Run-time memory checks:58; CHECK-NEXT:      Grouped accesses:59; CHECK-EMPTY:60; CHECK-NEXT:      Non vectorizable stores to invariant address were not found in loop.61; CHECK-NEXT:      SCEV assumptions:62; CHECK-EMPTY:63; CHECK-NEXT:      Expressions re-written:64;65entry:66  %A.plus.1 = getelementptr i32, ptr %A, i64 167  br label %loop68 69loop:70  %iv = phi i64 [ 1022, %entry ], [ %iv.next, %loop ]71  %gep.A = getelementptr inbounds i32, ptr %A, i64 %iv72  store i32 0, ptr %gep.A, align 473  %gep.A.plus.1 = getelementptr i32, ptr %A.plus.1, i64 %iv74  %l = load i32, ptr %gep.A.plus.1, align 475  store i32 %l, ptr %B76  %iv.next = add nsw i64 %iv, -177  %cmp.not = icmp eq i64 %iv, 078  br i1 %cmp.not, label %exit, label %loop79 80exit:81  ret void82}83