78 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 52; RUN: opt < %s -passes=memcpyopt,dse -S -verify-memoryssa | FileCheck %s3 4define void @test() local_unnamed_addr {5; CHECK-LABEL: define void @test() local_unnamed_addr {6; CHECK-NEXT: [[TEST_ARRAY_B:%.*]] = alloca [31 x float], align 47; CHECK-NEXT: [[TMP1:%.*]] = getelementptr float, ptr [[TEST_ARRAY_B]], i64 18; CHECK-NEXT: store float 0x3E6AA51880000000, ptr [[TMP1]], align 49; CHECK-NEXT: [[TMP2:%.*]] = getelementptr float, ptr [[TEST_ARRAY_B]], i64 110; CHECK-NEXT: [[TMP3:%.*]] = load float, ptr [[TMP2]], align 411; CHECK-NEXT: ret void12;13 %test_array_a = alloca [31 x float], align 414 %test_array_b = alloca [31 x float], align 415 %1 = getelementptr float, ptr %test_array_b, i64 116 store float 0x3E6AA51880000000, ptr %1, align 4, !tbaa !417 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(124) %test_array_a, ptr noundef nonnull align 4 dereferenceable(124) %test_array_b, i64 124, i1 false)18 %2 = getelementptr float, ptr %test_array_a, i64 119 %3 = load float, ptr %2, align 4, !tbaa !720 ret void21}22 23%struct.Outer = type { float, double, %struct.Inner }24%struct.Inner = type { i32, float }25 26; Function Attrs: nounwind uwtable27define dso_local float @f() {28; CHECK-LABEL: define dso_local float @f() {29; CHECK-NEXT: [[ENTRY:.*:]]30; CHECK-NEXT: [[TEST1:%.*]] = alloca [[STRUCT_OUTER:%.*]], align 831; CHECK-NEXT: [[F:%.*]] = getelementptr inbounds nuw [[STRUCT_OUTER]], ptr [[TEST1]], i32 0, i32 032; CHECK-NEXT: store float 0.000000e+00, ptr [[F]], align 833; CHECK-NEXT: [[F1:%.*]] = getelementptr inbounds nuw [[STRUCT_OUTER]], ptr [[TEST1]], i32 0, i32 034; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[F1]], align 835; CHECK-NEXT: [[ADD:%.*]] = fadd float [[TMP0]], 2.000000e+0036; CHECK-NEXT: store float [[ADD]], ptr [[F1]], align 837; CHECK-NEXT: [[F2:%.*]] = getelementptr inbounds nuw [[STRUCT_OUTER]], ptr [[TEST1]], i32 0, i32 038; CHECK-NEXT: [[TMP1:%.*]] = load float, ptr [[F2]], align 839; CHECK-NEXT: ret float [[TMP1]]40;41entry:42 %test = alloca %struct.Outer, align 843 %test1 = alloca %struct.Outer, align 844 %f = getelementptr inbounds nuw %struct.Outer, ptr %test1, i32 0, i32 045 store float 0.000000e+00, ptr %f, align 8, !tbaa !946 %inner_a = getelementptr inbounds nuw %struct.Outer, ptr %test1, i32 0, i32 247 %i = getelementptr inbounds nuw %struct.Inner, ptr %inner_a, i32 0, i32 048 store i32 0, ptr %i, align 8, !tbaa !1749 call void @llvm.memcpy.p0.p0.i64(ptr align 8 %test, ptr align 8 %test1, i64 24, i1 false)50 %f1 = getelementptr inbounds nuw %struct.Outer, ptr %test, i32 0, i32 051 %0 = load float, ptr %f1, align 8, !tbaa !952 %add = fadd float %0, 2.000000e+0053 store float %add, ptr %f1, align 8, !tbaa !954 %f2 = getelementptr inbounds nuw %struct.Outer, ptr %test, i32 0, i32 055 %1 = load float, ptr %f2, align 8, !tbaa !956 ret float %157}58 59!1 = !{!"any data access", !2, i64 0}60!2 = !{!"any access", !3, i64 0}61!3 = !{!"Flang function root test"}62!4 = !{!5, !5, i64 0}63!5 = !{!"allocated data/test_array_a", !6, i64 0}64!6 = !{!"allocated data", !1, i64 0}65!7 = !{!8, !8, i64 0}66!8 = !{!"allocated data/test_array_b", !6, i64 0}67!9 = !{!10, !11, i64 0}68!10 = !{!"Outer", !11, i64 0, !14, i64 8, !15, i64 16}69!11 = !{!"float", !12, i64 0}70!12 = !{!"omnipotent char", !13, i64 0}71!13 = !{!"Simple C/C++ TBAA"}72!14 = !{!"double", !12, i64 0}73!15 = !{!"Inner", !16, i64 0, !11, i64 4}74!16 = !{!"int", !12, i64 0}75!17 = !{!10, !16, i64 16}76 77 78