xref: /llvm-project/llvm/test/Transforms/SampleProfile/pseudo-probe-memset.ll (revision a11faeed446882a81e79d780125d93e7199df645)
1*a11faeedSBjorn Pettersson; RUN: opt < %s -passes=memcpyopt -S | FileCheck %s
230bb5be3SHongtao Yu
330bb5be3SHongtao Yu%struct.MV = type { i16, i16 }
430bb5be3SHongtao Yu
50271ae65SFangrui Songdefine void @test(ptr nocapture %c) nounwind optsize {
630bb5be3SHongtao Yu; All the stores in this example should be merged into a single memset.
730bb5be3SHongtao Yu; CHECK-NOT:  store i32 -1
80271ae65SFangrui Song; CHECK: call void @llvm.memset.p0.i64
90271ae65SFangrui Song  store i32 -1, ptr %c, align 4
100271ae65SFangrui Song  %1 = getelementptr inbounds i32, ptr %c, i32 1
110271ae65SFangrui Song  store i32 -1, ptr %1, align 4
120271ae65SFangrui Song  %2 = getelementptr inbounds i32, ptr %c, i32 2
130271ae65SFangrui Song  store i32 -1, ptr %2, align 4
1430bb5be3SHongtao Yu  call void @llvm.pseudoprobe(i64 5116412291814990879, i64 1, i32 0, i64 -1)
150271ae65SFangrui Song  %3 = getelementptr inbounds i32, ptr %c, i32 3
160271ae65SFangrui Song  store i32 -1, ptr %3, align 4
170271ae65SFangrui Song  %4 = getelementptr inbounds i32, ptr %c, i32 4
180271ae65SFangrui Song  store i32 -1, ptr %4, align 4
1930bb5be3SHongtao Yu  ret void
2030bb5be3SHongtao Yu}
2130bb5be3SHongtao Yu
2230bb5be3SHongtao Yu; Function Attrs: inaccessiblememonly nounwind willreturn
2330bb5be3SHongtao Yudeclare void @llvm.pseudoprobe(i64, i64, i32, i64) #0
2430bb5be3SHongtao Yu
2530bb5be3SHongtao Yuattributes #0 = { inaccessiblememonly nounwind willreturn }
26