Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/Transforms/LoopVectorize/unsafe-dep-remark.ll
; RUN: opt -loop-vectorize -force-vector-width=2 -pass-remarks-analysis=loop-vectorize < %s 2>&1 | FileCheck %s | ; RUN: opt -loop-vectorize -force-vector-width=2 -pass-remarks-analysis=loop-vectorize < %s 2>&1 | FileCheck %s | ||||
; ModuleID = '/tmp/kk.c' | ; ModuleID = '/tmp/kk.c' | ||||
source_filename = "/tmp/kk.c" | source_filename = "/tmp/kk.c" | ||||
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" | ||||
; 1 void success (char *A, char *B, char *C, char *D, char *E, int N) { | ; 1 void success (char *A, char *B, char *C, char *D, char *E, int N) { | ||||
; 2 for(int i = 0; i < N; i++) { | ; 2 for(int i = 0; i < N; i++) { | ||||
; 3 A[i + 1] = A[i] + B[i]; | ; 3 A[i + 1] = A[i] + B[i]; | ||||
; 4 C[i] = D[i] * E[i]; | ; 4 C[i] = D[i] * E[i]; | ||||
; 5 } | ; 5 } | ||||
; 6 } | ; 6 } | ||||
; CHECK: remark: /tmp/kk.c:2:3: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop | ; CHECK: remark: /tmp/kk.c:3:14: loop not vectorized: unsafe dependent memory operations in loop. Use #pragma loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop | ||||
define void @success(i8* nocapture %A, i8* nocapture readonly %B, i8* nocapture %C, i8* nocapture readonly %D, i8* nocapture readonly %E, i32 %N) !dbg !6 { | define void @success(i8* nocapture %A, i8* nocapture readonly %B, i8* nocapture %C, i8* nocapture readonly %D, i8* nocapture readonly %E, i32 %N) !dbg !6 { | ||||
entry: | entry: | ||||
%cmp28 = icmp sgt i32 %N, 0, !dbg !8 | %cmp28 = icmp sgt i32 %N, 0, !dbg !8 | ||||
br i1 %cmp28, label %for.body, label %for.cond.cleanup, !dbg !9 | br i1 %cmp28, label %for.body, label %for.cond.cleanup, !dbg !9 | ||||
for.body: ; preds = %entry, %for.body | for.body: ; preds = %entry, %for.body | ||||
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] | %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] | ||||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |