72 lines · plain
1; RUN: opt %loadNPMPolly -polly-invariant-load-hoisting=true '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s --check-prefix=SCOP2; RUN: opt %loadNPMPolly -S '-passes=polly<no-default-opts>' -polly-invariant-load-hoisting=true %s | FileCheck %s3;4; The offset of the %tmp1 load wrt. to %buff (62 bytes) is not divisible5; by the type size (i32 = 4 bytes), thus we will have to represent %buff6; with a smaller type. In this case i16 is sufficient to represent the7; 62 byte offset accurately.8;9; SCOP: Invariant Accesses: {10; SCOP: ReadAccess := [Reduction Type: NONE] [Scalar: 0]11; SCOP: { Stmt_if_end_6[] -> MemRef_buff[o0] : 31 <= o0 <= 32 };12; SCOP: Execution Context: { : }13; SCOP: }14; SCOP: Arrays {15; SCOP: i16 MemRef_buff[*]; // Element size 216; SCOP: i32 MemRef_key_0; // Element size 417; SCOP: }18;19; CHECK-LABEL: polly.preload.begin:20; CHECK-NEXT: %polly.access.buff = getelementptr i16, ptr %buff, i64 3121; CHECK-NEXT: %polly.access.buff.load = load i32, ptr %polly.access.buff, align 422; CHECK-NEXT: store i32 %polly.access.buff.load, ptr %tmp1.preload.s2a23;24target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"25 26; Function Attrs: nounwind uwtable27define void @sudecrypt(ptr %buff) {28entry:29 br i1 undef, label %cleanup, label %if.end30 31if.end: ; preds = %entry32 br i1 undef, label %if.end.6, label %if.then.533 34if.then.5: ; preds = %if.end35 unreachable36 37if.end.6: ; preds = %if.end38 %add.ptr = getelementptr inbounds i8, ptr %buff, i64 6239 %tmp1 = load i32, ptr %add.ptr, align 4, !tbaa !140 br i1 false, label %if.then.13, label %switch.early.test41 42switch.early.test: ; preds = %if.end.643 switch i32 0, label %if.end.16 [44 i32 956, label %if.then.1345 i32 520, label %if.then.1346 ]47 48if.then.13: ; preds = %switch.early.test, %switch.early.test, %if.end.649 br label %if.end.1650 51if.end.16: ; preds = %if.then.13, %switch.early.test52 %key.0 = phi i32 [ undef, %if.then.13 ], [ 0, %switch.early.test ]53 br i1 undef, label %if.end.34, label %if.then.1954 55if.then.19: ; preds = %if.end.1656 unreachable57 58if.end.34: ; preds = %if.end.1659 unreachable60 61cleanup: ; preds = %entry62 ret void63}64 65!llvm.ident = !{!0}66 67!0 = !{!"clang version 3.8.0 (trunk 250010) (llvm/trunk 250018)"}68!1 = !{!2, !2, i64 0}69!2 = !{!"int", !3, i64 0}70!3 = !{!"omnipotent char", !4, i64 0}71!4 = !{!"Simple C/C++ TBAA"}72