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