1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=dse < %s | FileCheck %s
4 ; malloc should have i64 argument under default data layout
5 declare noalias ptr @malloc(i32)
7 define ptr @malloc_and_memset_intrinsic(i32 %n) {
8 ; CHECK-LABEL: @malloc_and_memset_intrinsic(
9 ; CHECK-NEXT: [[CALL:%.*]] = call ptr @malloc(i32 [[N:%.*]])
10 ; CHECK-NEXT: call void @llvm.memset.p0.i32(ptr align 1 [[CALL]], i8 0, i32 [[N]], i1 false)
11 ; CHECK-NEXT: ret ptr [[CALL]]
13 %call = call ptr @malloc(i32 %n)
14 call void @llvm.memset.p0.i32(ptr align 1 %call, i8 0, i32 %n, i1 false)
18 declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1 immarg) #2