brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.5 KiB · 0001b8a Raw
95 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<ast>' -polly-print-ast -polly-process-unprofitable -polly-allow-nonaffine -disable-output < %s 2>&1 | FileCheck %s2;3; @test14; Make sure we generate the correct aliasing check for a fixed-size memset operation.5; CHECK: if (1 && (&MemRef_tmp0[15] <= &MemRef_tmp1[0] || &MemRef_tmp1[32] <= &MemRef_tmp0[14]))6;7; @test28; Make sure we generate the correct aliasing check for a variable-size memset operation.9; CHECK: if (1 && (&MemRef_tmp0[15] <= &MemRef_tmp1[0] || &MemRef_tmp1[n] <= &MemRef_tmp0[14]))10;11; @test312; We can't do anything interesting with a non-affine memset; just make sure it doesn't crash.13;14target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"15 16%struct.info = type { i32, ptr, i32, ptr, ptr, i32, ptr, i32, i32, double }17%struct.ctr = type { i32, i8, i8, i32 }18%struct.ord = type { i32, i8 }19 20; Function Attrs: argmemonly nounwind21declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i32, i1) #022 23define void @test1(ptr %ppIdxInfo) {24entry:25  %tmp0 = load ptr, ptr %ppIdxInfo, align 826  br label %if.end12527 28if.end125:                                        ; preds = %entry29  %tmp1 = load ptr, ptr undef, align 830  br label %for.end14331 32for.end143:                                       ; preds = %if.end12533  tail call void @llvm.memset.p0.i64(ptr %tmp1, i8 0, i64 32, i32 4, i1 false)34  %needToFreeIdxStr = getelementptr inbounds %struct.info, ptr %tmp0, i64 0, i32 735  %tmp3 = load i32, ptr %needToFreeIdxStr, align 836  br i1 false, label %if.end149, label %if.then14837 38if.then148:                                       ; preds = %for.end14339  br label %if.end14940 41if.end149:                                        ; preds = %if.then148, %for.end14342  ret void43}44 45define void @test2(ptr %ppIdxInfo, i64 %n) {46entry:47  %tmp0 = load ptr, ptr %ppIdxInfo, align 848  br label %if.end12549 50if.end125:                                        ; preds = %entry51  %tmp1 = load ptr, ptr undef, align 852  br label %for.end14353 54for.end143:                                       ; preds = %if.end12555  tail call void @llvm.memset.p0.i64(ptr %tmp1, i8 0, i64 %n, i32 4, i1 false)56  %needToFreeIdxStr = getelementptr inbounds %struct.info, ptr %tmp0, i64 0, i32 757  %tmp3 = load i32, ptr %needToFreeIdxStr, align 858  br i1 false, label %if.end149, label %if.then14859 60if.then148:                                       ; preds = %for.end14361  br label %if.end14962 63if.end149:                                        ; preds = %if.then148, %for.end14364  ret void65}66 67define i32 @test3(ptr %x, i32 %n) {68entry:69  br label %entry.split70 71entry.split:                                      ; preds = %entry72  %conv = sext i32 %n to i6473  %cmp8 = icmp sgt i32 %n, 074  br i1 %cmp8, label %for.body.lr.ph, label %for.cond.cleanup75 76for.body.lr.ph:                                   ; preds = %entry.split77  br label %for.body78 79for.cond.cleanup:                                 ; preds = %for.body, %entry.split80  ret i32 081 82for.body:                                         ; preds = %for.body, %for.body.lr.ph83  %i.09 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]84  %mul = mul nsw i64 %i.09, %i.0985  tail call void @llvm.memset.p0.i64(ptr %x, i8 0, i64 %mul, i32 4, i1 false)86  %add = add nuw nsw i64 %i.09, 100087  %arrayidx = getelementptr inbounds i32, ptr %x, i64 %add88  store i32 5, ptr %arrayidx, align 489  %inc = add nuw nsw i64 %i.09, 190  %exitcond = icmp eq i64 %inc, %conv91  br i1 %exitcond, label %for.cond.cleanup, label %for.body92}93 94attributes #0 = { argmemonly nounwind }95