xref: /llvm-project/llvm/test/Transforms/GlobalOpt/ARM/arm-widen-global-dest.ll (revision e37d736def5b95a2710f92881b5fc8b0494d8a05)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2; RUN: opt < %s -mtriple=arm-none-eabi -passes=globalopt -S | FileCheck %s
3
4; CHECK: [3 x i8]
5@other = private unnamed_addr global [3 x i8] [i8 1, i8 2, i8 3] , align 1
6; CHECK: [4 x i8]
7@.i8 = private unnamed_addr constant [3 x i8] [i8 1, i8 2, i8 3] , align 1
8
9define  void @memcpy_multiple()  {
10; CHECK-LABEL: define void @memcpy_multiple() local_unnamed_addr {
11; CHECK-NEXT:  [[ENTRY:.*:]]
12; CHECK-NEXT:    [[SOMETHING:%.*]] = alloca [4 x i8], align 1
13; CHECK-NEXT:    [[CALL2:%.*]] = call i32 @bar(ptr nonnull [[SOMETHING]])
14; CHECK-NEXT:    [[CALL3:%.*]] = call i32 @bar(ptr nonnull @other)
15; CHECK-NEXT:    call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(3) @other, ptr noundef nonnull align 1 dereferenceable(3) @.i8, i32 3, i1 false)
16; CHECK-NEXT:    call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(3) [[SOMETHING]], ptr noundef nonnull align 1 dereferenceable(3) @.i8, i32 4, i1 false)
17; CHECK-NEXT:    ret void
18;
19entry:
20  %something = alloca [3 x i8], align 1
21  %call1 = call i32 @bar(ptr nonnull %something)
22  %call2 = call i32 @bar(ptr nonnull @other)
23  call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(3) @other, ptr noundef nonnull align 1 dereferenceable(3) @.i8, i32 3, i1 false)
24  call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(3) %something, ptr noundef nonnull align 1 dereferenceable(3) @.i8, i32 3, i1 false)
25  ret void
26}
27
28declare i32 @bar(...)
29