Files
clang-p2996/llvm/test/Verifier/memset-inline.ll
Guillaume Chatelet 38637ee477 [clang] Add support for __builtin_memset_inline
In the same spirit as D73543 and in reply to https://reviews.llvm.org/D126768#3549920 this patch is adding support for `__builtin_memset_inline`.

The idea is to get support from the compiler to easily write efficient memory function implementations.

This patch could be split in two:
 - one for the LLVM part adding the `llvm.memset.inline.*` intrinsics.
 - and another one for the Clang part providing the instrinsic as a builtin.

Differential Revision: https://reviews.llvm.org/D126903
2022-06-10 13:13:59 +00:00

10 lines
307 B
LLVM

; RUN: not opt -verify < %s 2>&1 | FileCheck %s
; CHECK: alignment is not a power of two
define void @foo(i8* %P, i8 %value) {
call void @llvm.memset.inline.p0i8.i32(i8* align 3 %P, i8 %value, i32 4, i1 false)
ret void
}
declare void @llvm.memset.inline.p0i8.i32(i8* nocapture, i8, i32, i1) nounwind