97 lines · plain
1; REQUIRES: asserts2; RUN: opt -passes=loop-vectorize -debug-only=loop-accesses -force-vector-width=4 -disable-output %s 2>&1 | FileCheck %s -check-prefix=LOOP-ACCESS3; RUN: opt -passes=loop-vectorize -debug-only=vectorutils -force-vector-width=4 -disable-output %s 2>&1 | FileCheck %s4target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"5target triple = "x86_64-redhat-linux-gnu"6 7%struct.foo = type { ptr, ptr, ptr }8%struct.pluto = type <{ %struct.wombat, %struct.spam, %struct.wibble, [6 x i8] }>9%struct.wombat = type { %struct.barney }10%struct.barney = type { %struct.widget }11%struct.widget = type { %struct.hoge }12%struct.hoge = type { %struct.pluto.0 }13%struct.pluto.0 = type { %struct.foo }14%struct.spam = type { %struct.barney.1 }15%struct.barney.1 = type { %struct.ham }16%struct.ham = type { %struct.bar }17%struct.bar = type { %struct.barney.2 }18%struct.barney.2 = type { %struct.hoge.3 }19%struct.hoge.3 = type { ptr, ptr, ptr }20%struct.wibble = type { %struct.spam.4 }21%struct.spam.4 = type { [2 x %struct.zot] }22%struct.zot = type { %struct.bar.5 }23%struct.bar.5 = type { i8 }24%struct.baz = type { i64, %struct.pluto }25 26; LOOP-ACCESS: Too many dependences, stopped recording27 28; If no dependences are recorded because there are too many, LoopAccessAnalysis29; just conservatively returns true for any pair of instructions compared (even30; those belonging to the same store group). This tests make sure that we do not31; incorrectly release a store group which had no dependences between its32; members, even if we have no dependences recorded because there are too many. 33 34; CHECK: LV: Creating an interleave group with: store ptr null, ptr %phi5, align 835; CHECK: LV: Inserted: store ptr %load12, ptr %getelementptr11, align 836; CHECK: into the interleave group with store ptr null, ptr %phi537; CHECK: LV: Inserted: store ptr %load7, ptr %getelementptr, align 838; CHECK: into the interleave group with store ptr null, ptr %phi539 40; CHECK: LV: Creating an interleave group with: store ptr null, ptr %getelementptr13, align 841; CHECK: LV: Inserted: store ptr null, ptr %phi6, align 842; CHECK: into the interleave group with store ptr null, ptr %getelementptr1343; CHECK: LV: Invalidated store group due to dependence between store ptr %load7, ptr %getelementptr, align 8 and store ptr null, ptr %getelementptr13, align 844; CHECK-NOT: LV: Invalidated store group due to dependence between45 46; Note: The (only) invalidated store group is the one containing A (store ptr %load7, ptr %getelementptr, align 8) which is:47; Group with instructions: 48; store ptr null, ptr %phi5, align 849; store ptr %load7, ptr %getelementptr, align 850; store ptr %load12, ptr %getelementptr11, align 851define void @test(ptr %arg, ptr %arg1) local_unnamed_addr #0 {52bb:53 br label %bb254 55bb2: ; preds = %bb4, %bb56 %phi = phi ptr [ %arg, %bb ], [ %phi3, %bb4 ]57 %phi3 = phi ptr [ %arg1, %bb ], [ null, %bb4 ]58 br label %bb459 60bb4: ; preds = %bb4, %bb261 %phi5 = phi ptr [ %getelementptr15, %bb4 ], [ %phi, %bb2 ]62 %phi6 = phi ptr [ %getelementptr14, %bb4 ], [ %phi3, %bb2 ]63 %load = load i64, ptr %phi5, align 864 store i64 %load, ptr %phi, align 865 store i64 0, ptr %phi3, align 866 %load7 = load ptr, ptr %phi6, align 867 %load8 = load ptr, ptr %phi5, align 868 store ptr %load8, ptr %phi6, align 869 %getelementptr = getelementptr %struct.foo, ptr %phi5, i64 0, i32 170 %load9 = load ptr, ptr %phi5, align 871 store ptr %load9, ptr %phi6, align 872 %load10 = load ptr, ptr %phi5, align 873 store ptr %load10, ptr %phi6, align 874 store ptr null, ptr %phi5, align 875 store ptr %load7, ptr %getelementptr, align 876 %getelementptr11 = getelementptr %struct.pluto, ptr %phi5, i64 0, i32 177 %load12 = load ptr, ptr %phi6, align 878 %getelementptr13 = getelementptr %struct.pluto, ptr %phi6, i64 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 279 store ptr null, ptr %phi6, align 880 store ptr null, ptr %getelementptr13, align 881 store ptr %load12, ptr %getelementptr11, align 882 store ptr null, ptr %phi5, align 883 %getelementptr14 = getelementptr inbounds %struct.baz, ptr %phi6, i64 184 %getelementptr15 = getelementptr %struct.baz, ptr %phi5, i64 185 %icmp = icmp eq ptr %phi6, %phi86 br i1 %icmp, label %bb2, label %bb487}88 89; Function Attrs: memory(readwrite, inaccessiblemem: none)90declare void @foo() local_unnamed_addr #091 92; Function Attrs: memory(argmem: readwrite)93declare void @pluto() local_unnamed_addr #194 95attributes #0 = { memory(readwrite, inaccessiblemem: none) }96attributes #1 = { memory(argmem: readwrite) }97