2016-12-29 15:31:07 +01:00
|
|
|
; RUN: not opt -verify < %s 2>&1 | FileCheck %s
|
|
|
|
|
2017-06-16 16:43:59 +02:00
|
|
|
define void @test_memcpy(i8* %P, i8* %Q, i32 %A, i32 %E) {
|
2019-03-12 22:02:54 +01:00
|
|
|
; CHECK: immarg operand has non-immediate parameter
|
|
|
|
; CHECK: i32 %E
|
|
|
|
; CHECK-NEXT: call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 1, i32 %E)
|
2017-06-16 16:43:59 +02:00
|
|
|
call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 1, i32 %E)
|
2019-03-12 22:02:54 +01:00
|
|
|
|
2016-12-29 15:31:07 +01:00
|
|
|
; CHECK: element size of the element-wise atomic memory intrinsic must be a power of 2
|
2017-06-16 16:43:59 +02:00
|
|
|
call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 1, i32 3)
|
2016-12-29 15:31:07 +01:00
|
|
|
|
2017-06-16 16:43:59 +02:00
|
|
|
call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 7, i32 4)
|
|
|
|
|
|
|
|
; CHECK: incorrect alignment of the destination argument
|
|
|
|
call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* %P, i8* align 4 %Q, i32 1, i32 1)
|
2016-12-29 15:31:07 +01:00
|
|
|
; CHECK: incorrect alignment of the destination argument
|
2017-06-16 16:43:59 +02:00
|
|
|
call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 1 %P, i8* align 4 %Q, i32 4, i32 4)
|
2016-12-29 15:31:07 +01:00
|
|
|
|
|
|
|
; CHECK: incorrect alignment of the source argument
|
2017-06-16 16:43:59 +02:00
|
|
|
call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* %Q, i32 1, i32 1)
|
|
|
|
; CHECK: incorrect alignment of the source argument
|
|
|
|
call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 1 %Q, i32 4, i32 4)
|
2016-12-29 15:31:07 +01:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
2019-03-12 22:02:54 +01:00
|
|
|
|
2017-06-16 16:43:59 +02:00
|
|
|
declare void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32) nounwind
|
2017-07-12 17:25:26 +02:00
|
|
|
|
|
|
|
define void @test_memmove(i8* %P, i8* %Q, i32 %A, i32 %E) {
|
2019-03-12 22:02:54 +01:00
|
|
|
; CHECK: immarg operand has non-immediate parameter
|
|
|
|
; CHECK-NEXT: i32 %E
|
|
|
|
; CHECK-NEXT: call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 1, i32 %E)
|
2017-07-12 17:25:26 +02:00
|
|
|
call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 1, i32 %E)
|
2019-03-12 22:02:54 +01:00
|
|
|
|
2017-07-12 17:25:26 +02:00
|
|
|
; CHECK: element size of the element-wise atomic memory intrinsic must be a power of 2
|
|
|
|
call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 1, i32 3)
|
|
|
|
|
|
|
|
call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 4 %Q, i32 7, i32 4)
|
|
|
|
|
|
|
|
; CHECK: incorrect alignment of the destination argument
|
|
|
|
call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* %P, i8* align 4 %Q, i32 1, i32 1)
|
|
|
|
; CHECK: incorrect alignment of the destination argument
|
|
|
|
call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 1 %P, i8* align 4 %Q, i32 4, i32 4)
|
|
|
|
|
|
|
|
; CHECK: incorrect alignment of the source argument
|
|
|
|
call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* %Q, i32 1, i32 1)
|
|
|
|
; CHECK: incorrect alignment of the source argument
|
|
|
|
call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* align 4 %P, i8* align 1 %Q, i32 4, i32 4)
|
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
2019-03-12 22:02:54 +01:00
|
|
|
|
2017-07-12 17:25:26 +02:00
|
|
|
declare void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32) nounwind
|
|
|
|
|
Add element atomic memset intrinsic
Summary: Continuing the work from https://reviews.llvm.org/D33240, this change introduces an element unordered-atomic memset intrinsic. This intrinsic is essentially memset with the implementation requirement that all stores used for the assignment are done with unordered-atomic stores of a given element size.
Reviewers: eli.friedman, reames, mkazantsev, skatkov
Reviewed By: reames
Subscribers: jfb, dschuff, sbc100, jgravelle-google, aheejin, efriedma, llvm-commits
Differential Revision: https://reviews.llvm.org/D34885
llvm-svn: 307854
2017-07-12 23:57:23 +02:00
|
|
|
define void @test_memset(i8* %P, i8 %V, i32 %A, i32 %E) {
|
2019-03-12 22:02:54 +01:00
|
|
|
; CHECK: immarg operand has non-immediate parameter
|
|
|
|
; CHECK: i32 %E
|
|
|
|
; CHECK: call void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* align 4 %P, i8 %V, i32 1, i32 %E)
|
Add element atomic memset intrinsic
Summary: Continuing the work from https://reviews.llvm.org/D33240, this change introduces an element unordered-atomic memset intrinsic. This intrinsic is essentially memset with the implementation requirement that all stores used for the assignment are done with unordered-atomic stores of a given element size.
Reviewers: eli.friedman, reames, mkazantsev, skatkov
Reviewed By: reames
Subscribers: jfb, dschuff, sbc100, jgravelle-google, aheejin, efriedma, llvm-commits
Differential Revision: https://reviews.llvm.org/D34885
llvm-svn: 307854
2017-07-12 23:57:23 +02:00
|
|
|
call void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* align 4 %P, i8 %V, i32 1, i32 %E)
|
2019-03-12 22:02:54 +01:00
|
|
|
|
Add element atomic memset intrinsic
Summary: Continuing the work from https://reviews.llvm.org/D33240, this change introduces an element unordered-atomic memset intrinsic. This intrinsic is essentially memset with the implementation requirement that all stores used for the assignment are done with unordered-atomic stores of a given element size.
Reviewers: eli.friedman, reames, mkazantsev, skatkov
Reviewed By: reames
Subscribers: jfb, dschuff, sbc100, jgravelle-google, aheejin, efriedma, llvm-commits
Differential Revision: https://reviews.llvm.org/D34885
llvm-svn: 307854
2017-07-12 23:57:23 +02:00
|
|
|
; CHECK: element size of the element-wise atomic memory intrinsic must be a power of 2
|
|
|
|
call void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* align 4 %P, i8 %V, i32 1, i32 3)
|
|
|
|
|
|
|
|
call void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* align 4 %P, i8 %V, i32 7, i32 4)
|
|
|
|
|
|
|
|
; CHECK: incorrect alignment of the destination argument
|
|
|
|
call void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* %P, i8 %V, i32 1, i32 1)
|
|
|
|
; CHECK: incorrect alignment of the destination argument
|
|
|
|
call void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* align 1 %P, i8 %V, i32 4, i32 4)
|
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
declare void @llvm.memset.element.unordered.atomic.p0i8.i32(i8* nocapture, i8, i32, i32) nounwind
|
|
|
|
|
2016-12-29 15:31:07 +01:00
|
|
|
; CHECK: input module is broken!
|