1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -basic-aa -memcpyopt -S -verify-memoryssa | FileCheck %s
3 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
8 declare void @g(%a* nocapture)
13 ; CHECK-NEXT: [[A_VAR:%.*]] = alloca [[A:%.*]], align 8
14 ; CHECK-NEXT: [[B_VAR:%.*]] = alloca [[B:%.*]], align 8
15 ; CHECK-NEXT: [[B_VAR1:%.*]] = bitcast %b* [[B_VAR]] to %a*
16 ; CHECK-NEXT: call void @g(%a* [[B_VAR1]])
17 ; CHECK-NEXT: [[A_I8:%.*]] = bitcast %a* [[A_VAR]] to i8*
18 ; CHECK-NEXT: [[B_I8:%.*]] = bitcast %b* [[B_VAR]] to i8*
19 ; CHECK-NEXT: [[TMP1:%.*]] = getelementptr [[B]], %b* [[B_VAR]], i32 0, i32 0
20 ; CHECK-NEXT: [[TMP2:%.*]] = load float, float* [[TMP1]], align 4
21 ; CHECK-NEXT: ret float [[TMP2]]
25 %b_var = alloca %b, align 1
26 call void @g(%a* %a_var)
27 %a_i8 = bitcast %a* %a_var to i8*
28 %b_i8 = bitcast %b* %b_var to i8*
29 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %b_i8, i8* %a_i8, i32 4, i1 false)
30 %tmp1 = getelementptr %b, %b* %b_var, i32 0, i32 0
31 %tmp2 = load float, float* %tmp1
35 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind