42 lines · plain
1; RUN: opt -S -passes=loop-vectorize,instcombine -force-vector-width=4 -force-vector-interleave=1 -enable-interleaved-mem-accesses=true -runtime-memory-check-threshold=24 --pass-remarks=loop-vectorize < %s | FileCheck %s2 3target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"4 5 6; This only tests that asking for remarks doesn't lead to compiler crashing7; (or timing out). We just check for output. To be sure, we also check we didn't8; vectorize.9; CHECK-LABEL: @atomicLoadsBothWriteAndReadMem10; CHECK-NOT: <{{[0-9]+}} x i8>11 12%"struct.std::__atomic_base" = type { i32 }13%"struct.std::atomic" = type { %"struct.std::__atomic_base" }14%union.anon = type { i64 }15%MyStruct = type { i32, %"struct.std::atomic", %union.anon }16 17define void @atomicLoadsBothWriteAndReadMem(ptr %a, ptr %b, ptr %lim) {18entry:19 br label %loop20 21loop:22 %0 = phi ptr [ %a, %entry ], [ %ainc, %loop ]23 %1 = phi ptr [ %b, %entry ], [ %binc, %loop ]24 %2 = load i32, ptr %1, align 825 store i32 %2, ptr %0, align 826 %3 = getelementptr inbounds %MyStruct, ptr %1, i64 0, i32 1, i32 0, i32 027 %4 = load atomic i32, ptr %3 monotonic, align 428 %5 = getelementptr inbounds %MyStruct, ptr %0, i64 0, i32 1, i32 0, i32 029 store atomic i32 %4, ptr %5 monotonic, align 430 %6 = getelementptr inbounds %MyStruct, ptr %1, i64 0, i32 2, i32 031 %7 = getelementptr inbounds %MyStruct, ptr %0, i64 0, i32 2, i32 032 %8 = load i64, ptr %6, align 833 store i64 %8, ptr %7, align 834 %binc = getelementptr inbounds %MyStruct, ptr %1, i64 135 %ainc = getelementptr inbounds %MyStruct, ptr %0, i64 136 %cond = icmp eq ptr %binc, %lim37 br i1 %cond, label %exit, label %loop38 39exit:40 ret void41}42