llvm memcpy

memcpy函数:
The ‘llvm.memcpy.*’ intrinsics copy a block of memory from the source location to the destination location.

从源src所指的内存地址的起始位置开始拷贝N个字节到目标dst所指的内存地址的起始位置中。

Note that, unlike the standard libc function, the llvm.memcpy.* intrinsics do not return a value, takes extra isvolatile arguments and the pointers can be in specified address spaces.

The ‘llvm.memcpy.*’ 与c程序中memcpy不同之处在于不返回value。

declare void @llvm.memcpy.p0i8.p0i8.i32(i8* <dest>, i8* <src>,
                                        i32 <len>, i1 <isvolatile>)
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* <dest>, i8* <src>,
                                        i64 <len>, i1 <isvolatile>)

参数:
The first argument is a pointer to the destination, the second is a pointer to the source. The third argument is an integer argument specifying the number of bytes to copy, and the fourth is a boolean indicating a volatile access.
第一个参数是指向目标destination的指针,
第二个参数是指向源source的指针。
第三个参数是一个整数参数(length),指定要复制的字节数,
第四个参数是一个表示易失性访问的布尔值。

The align parameter attribute can be provided for the first and second arguments.

 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* bitcast (%struct.str* @main.global to i8*), i64 28, i32 8, i1 false) #3

该instruction中的i32 8 就是align,为第一个和第二个参数提供align参数属性。

If the isvolatile parameter is true, the llvm.memcpy call is a volatile operation. The detailed access behavior is not very cleanly specified and it is unwise to depend on it.

如果isvolatile参数为true,则llvm.memcpy调用是volatile操作。 详细的访问行为没有非常清晰地指定,依赖它是不明智的。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值