26 lines · plain
1; RUN: opt < %s -passes=memcpyopt -S | FileCheck %s2 3%struct.MV = type { i16, i16 }4 5define void @test(ptr nocapture %c) nounwind optsize {6; All the stores in this example should be merged into a single memset.7; CHECK-NOT: store i32 -18; CHECK: call void @llvm.memset.p0.i649 store i32 -1, ptr %c, align 410 %1 = getelementptr inbounds i32, ptr %c, i32 111 store i32 -1, ptr %1, align 412 %2 = getelementptr inbounds i32, ptr %c, i32 213 store i32 -1, ptr %2, align 414 call void @llvm.pseudoprobe(i64 5116412291814990879, i64 1, i32 0, i64 -1)15 %3 = getelementptr inbounds i32, ptr %c, i32 316 store i32 -1, ptr %3, align 417 %4 = getelementptr inbounds i32, ptr %c, i32 418 store i32 -1, ptr %4, align 419 ret void20}21 22; Function Attrs: inaccessiblememonly nounwind willreturn23declare void @llvm.pseudoprobe(i64, i64, i32, i64) #024 25attributes #0 = { inaccessiblememonly nounwind willreturn }26