File: pr37967.ll

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-6~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,418,812 kB
  • sloc: cpp: 5,290,827; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,900; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,892; xml: 953; cs: 573; fortran: 539
file content (34 lines) | stat: -rw-r--r-- 2,213 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -debugify -memcpyopt -check-debugify -S < %s 2>&1 -enable-memcpyopt-memoryssa=0 | FileCheck %s
; RUN: opt -debugify -memcpyopt -check-debugify -S < %s 2>&1 -enable-memcpyopt-memoryssa=1 -verify-memoryssa | FileCheck %s

; CHECK: CheckModuleDebugify: PASS

%struct.Foo = type { i64, i64, i64 }

@a = dso_local global %struct.Foo* null, align 8

define dso_local void @_Z3bar3Foo(%struct.Foo* byval(%struct.Foo) align 8 %0) {
; CHECK-LABEL: @_Z3bar3Foo(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[AGG_TMP:%.*]] = alloca [[STRUCT_FOO:%.*]], align 8, [[DBG13:!dbg !.*]]
; CHECK-NEXT:    call void @llvm.dbg.value(metadata %struct.Foo* [[AGG_TMP]], [[META9:metadata !.*]], metadata !DIExpression()), [[DBG13]]
; CHECK-NEXT:    [[TMP1:%.*]] = load i8*, i8** bitcast (%struct.Foo** @a to i8**), align 8, [[DBG14:!dbg !.*]]
; CHECK-NEXT:    call void @llvm.dbg.value(metadata i8* [[TMP1]], [[META11:metadata !.*]], metadata !DIExpression()), [[DBG14]]
; CHECK-NEXT:    [[TMP2:%.*]] = bitcast %struct.Foo* [[AGG_TMP]] to i8*, [[DBG15:!dbg !.*]]
; CHECK-NEXT:    call void @llvm.dbg.value(metadata i8* [[TMP2]], [[META12:metadata !.*]], metadata !DIExpression()), [[DBG15]]
; CHECK-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(24) [[TMP2]], i8* nonnull align 8 dereferenceable(24) [[TMP1]], i64 24, i1 false), [[DBG16:!dbg !.*]]
; CHECK-NEXT:    [[TMPCAST:%.*]] = bitcast i8* [[TMP1]] to %struct.Foo*, [[DBG16]]
; CHECK-NEXT:    call void @_Z3bar3Foo(%struct.Foo* nonnull byval(%struct.Foo) align 8 [[TMPCAST]]), [[DBG17:!dbg !.*]]
; CHECK-NEXT:    ret void, [[DBG18:!dbg !.*]]
;
entry:
  %agg.tmp = alloca %struct.Foo, align 8
  %1 = load i8*, i8** bitcast (%struct.Foo** @a to i8**), align 8
  %2 = bitcast %struct.Foo* %agg.tmp to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(24) %2, i8* nonnull align 8 dereferenceable(24) %1, i64 24, i1 false)
  call void @_Z3bar3Foo(%struct.Foo* nonnull byval(%struct.Foo) align 8 %agg.tmp)
  ret void
}

declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0