|
| 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 | +@.i8 = private unnamed_addr constant [3 x i8] [i8 1, i8 2, i8 3] , align 1 |
| 5 | + |
| 6 | +define void @memcpy() { |
| 7 | +; CHECK-LABEL: define void @memcpy() local_unnamed_addr { |
| 8 | +; CHECK-NEXT: [[ENTRY:.*:]] |
| 9 | +; CHECK-NEXT: [[ALLOCA1:%.*]] = alloca [4 x i8], align 1 |
| 10 | +; CHECK-NEXT: [[ALLOCA2:%.*]] = alloca [4 x i8], align 1 |
| 11 | +; CHECK-NEXT: [[CALL1:%.*]] = call i32 @bar(ptr nonnull [[ALLOCA1]]) |
| 12 | +; CHECK-NEXT: [[CALL2:%.*]] = call i32 @bar(ptr nonnull [[ALLOCA2]]) |
| 13 | +; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(3) [[ALLOCA1]], ptr noundef nonnull align 1 dereferenceable(3) @.i8, i32 4, i1 false) |
| 14 | +; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(5) [[ALLOCA2]], ptr noundef nonnull align 1 dereferenceable(3) @.i8, i32 4, i1 false) |
| 15 | +; CHECK-NEXT: ret void |
| 16 | +; |
| 17 | +entry: |
| 18 | + %alloca1 = alloca [3 x i8], align 1 |
| 19 | + %alloca2 = alloca [5 x i8], align 1 |
| 20 | + %call1 = call i32 @bar(ptr nonnull %alloca1) |
| 21 | + %call2 = call i32 @bar(ptr nonnull %alloca2) |
| 22 | + call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(3) %alloca1, ptr noundef nonnull align 1 dereferenceable(3) @.i8, i32 3, i1 false) |
| 23 | + call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(5) %alloca2, ptr noundef nonnull align 1 dereferenceable(3) @.i8, i32 3, i1 false) |
| 24 | + ret void |
| 25 | +} |
| 26 | + |
| 27 | +declare i32 @bar(...) |
0 commit comments