brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · 5ad6b00 Raw
69 lines · plain
1; RUN: opt -passes=dse -S < %s | FileCheck %s2target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"3target triple = "x86_64-unknown-linux-gnu"4 5%class.basic_string = type { %"class.__gnu_cxx::__versa_string" }6%"class.__gnu_cxx::__versa_string" = type { %"class.__gnu_cxx::__sso_string_base" }7%"class.__gnu_cxx::__sso_string_base" = type { %"struct.__gnu_cxx::__vstring_utility<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider", i64, %union.anon }8%"struct.__gnu_cxx::__vstring_utility<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider" = type { ptr }9%union.anon = type { i64, [8 x i8] }10 11; Function Attrs: nounwind12declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1) #013 14; Function Attrs: noinline nounwind readonly uwtable15declare zeroext i1 @callee_takes_string(ptr nonnull) #1 align 216 17; Function Attrs: nounwind uwtable18define weak_odr zeroext i1 @test() #2 align 2 {19 20; CHECK-LABEL: @test21 22bb:23  %tmp = alloca %class.basic_string, align 824  %tmp1 = alloca %class.basic_string, align 825  %tmp3 = getelementptr inbounds %class.basic_string, ptr %tmp, i64 0, i32 0, i32 0, i32 226  %tmp6 = getelementptr inbounds %class.basic_string, ptr %tmp, i64 0, i32 0, i32 0, i32 127  %tmp7 = getelementptr inbounds i8, ptr %tmp3, i64 128  %tmp9 = bitcast i64 0 to i6429  %tmp10 = getelementptr inbounds %class.basic_string, ptr %tmp1, i64 0, i32 0, i32 0, i32 230  %tmp13 = getelementptr inbounds %class.basic_string, ptr %tmp1, i64 0, i32 0, i32 0, i32 131  %tmp14 = getelementptr inbounds i8, ptr %tmp10, i64 132  br label %_ZN12basic_stringIcSt11char_traitsIcESaIcEEC2EPKcRKS2_.exit33 34_ZN12basic_stringIcSt11char_traitsIcESaIcEEC2EPKcRKS2_.exit: ; preds = %bb35  store ptr %tmp3, ptr %tmp, align 836  store i8 62, ptr %tmp3, align 837  store i64 1, ptr %tmp6, align 838  store i8 0, ptr %tmp7, align 139  %tmp16 = call zeroext i1 @callee_takes_string(ptr nonnull %tmp)40  br label %_ZN9__gnu_cxx17__sso_string_baseIcSt11char_traitsIcESaIcEED2Ev.exit341 42_ZN9__gnu_cxx17__sso_string_baseIcSt11char_traitsIcESaIcEED2Ev.exit3: ; preds = %_ZN12basic_stringIcSt11char_traitsIcESaIcEEC2EPKcRKS2_.exit43 44; CHECK: _ZN9__gnu_cxx17__sso_string_baseIcSt11char_traitsIcESaIcEED2Ev.exit3:45 46; The following can be read through the call %tmp17:47  store ptr %tmp10, ptr %tmp1, align 848  store i8 125, ptr %tmp10, align 849  store i64 1, ptr %tmp13, align 850  store i8 0, ptr %tmp14, align 151 52; CHECK: store ptr %tmp10, ptr %tmp1, align 853; CHECK: store i8 125, ptr %tmp10, align 854; CHECK: store i64 1, ptr %tmp13, align 855; CHECK: store i8 0, ptr %tmp14, align 156 57  %tmp17 = call zeroext i1 @callee_takes_string(ptr nonnull %tmp1)58  call void @llvm.memset.p0.i64(ptr align 8 %tmp10, i8 -51, i64 16, i1 false) #059  call void @llvm.memset.p0.i64(ptr align 8 %tmp1, i8 -51, i64 32, i1 false) #060  call void @llvm.memset.p0.i64(ptr align 8 %tmp3, i8 -51, i64 16, i1 false) #061  call void @llvm.memset.p0.i64(ptr align 8 %tmp, i8 -51, i64 32, i1 false) #062  ret i1 %tmp1763}64 65attributes #0 = { nounwind }66attributes #1 = { noinline nounwind readonly uwtable }67attributes #2 = { nounwind uwtable }68 69