2016-03-19 05:43:32 +08:00
|
|
|
// Test target codegen - host bc file has to be created first.
|
2016-07-01 05:22:08 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc
|
2017-08-09 02:04:06 +08:00
|
|
|
// RUN: %clang_cc1 -debug-info-kind=limited -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-64
|
2016-07-01 05:22:08 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm-bc %s -o %t-x86-host.bc
|
2017-08-09 02:04:06 +08:00
|
|
|
// RUN: %clang_cc1 -debug-info-kind=limited -verify -fopenmp -x c++ -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix TCHECK --check-prefix TCHECK-32
|
2016-03-19 05:43:32 +08:00
|
|
|
// expected-no-diagnostics
|
|
|
|
#ifndef HEADER
|
|
|
|
#define HEADER
|
|
|
|
|
2017-08-09 02:04:06 +08:00
|
|
|
template <typename tx, typename ty>
|
|
|
|
struct TT {
|
2016-03-19 05:43:32 +08:00
|
|
|
tx X;
|
|
|
|
ty Y;
|
|
|
|
};
|
|
|
|
|
|
|
|
// TCHECK: [[TT:%.+]] = type { i64, i8 }
|
|
|
|
// TCHECK: [[S1:%.+]] = type { double }
|
|
|
|
|
|
|
|
int foo(int n, double *ptr) {
|
|
|
|
int a = 0;
|
|
|
|
short aa = 0;
|
|
|
|
float b[10];
|
|
|
|
double c[5][10];
|
|
|
|
TT<long long, char> d;
|
2017-08-09 02:04:06 +08:00
|
|
|
|
|
|
|
#pragma omp target firstprivate(a) map(tofrom \
|
|
|
|
: b)
|
2016-03-19 05:43:32 +08:00
|
|
|
{
|
2017-08-09 02:04:06 +08:00
|
|
|
b[a] = a;
|
2016-03-19 05:43:32 +08:00
|
|
|
}
|
2017-08-09 02:04:06 +08:00
|
|
|
|
|
|
|
// TCHECK: define {{.*}}void @__omp_offloading_{{.+}}([10 x float] addrspace(1)* noalias [[B_IN:%.+]], i{{[0-9]+}} [[A_IN:%.+]])
|
2016-03-19 05:43:32 +08:00
|
|
|
// TCHECK: [[A_ADDR:%.+]] = alloca i{{[0-9]+}},
|
2016-05-17 16:55:33 +08:00
|
|
|
// TCHECK-NOT: alloca i{{[0-9]+}},
|
2017-08-24 04:31:27 +08:00
|
|
|
// TCHECK-64: call void @llvm.dbg.declare(metadata [10 x float] addrspace(1)** %{{.+}}, metadata !{{[0-9]+}}, metadata !DIExpression())
|
2016-03-19 05:43:32 +08:00
|
|
|
// TCHECK: store i{{[0-9]+}} [[A_IN]], i{{[0-9]+}}* [[A_ADDR]],
|
2017-08-09 02:04:06 +08:00
|
|
|
// TCHECK: ret void
|
2016-03-19 05:43:32 +08:00
|
|
|
|
2017-08-09 02:04:06 +08:00
|
|
|
#pragma omp target firstprivate(aa, b, c, d)
|
2016-03-19 05:43:32 +08:00
|
|
|
{
|
|
|
|
aa += 1;
|
|
|
|
b[2] = 1.0;
|
|
|
|
c[1][2] = 1.0;
|
|
|
|
d.X = 1;
|
2017-08-09 02:04:06 +08:00
|
|
|
d.Y = 1;
|
2016-03-19 05:43:32 +08:00
|
|
|
}
|
2017-08-09 02:04:06 +08:00
|
|
|
|
2016-03-19 05:43:32 +08:00
|
|
|
// make sure that firstprivate variables are generated in all cases and that we use those instances for operations inside the
|
|
|
|
// target region
|
2017-08-09 02:04:06 +08:00
|
|
|
// TCHECK: define {{.*}}void @__omp_offloading_{{.+}}(i{{[0-9]+}}{{.*}} [[A2_IN:%.+]], [10 x float]*{{.*}} [[B_IN:%.+]], [5 x [10 x double]]*{{.*}} [[C_IN:%.+]], [[TT]]*{{.*}} [[D_IN:%.+]])
|
2016-03-19 05:43:32 +08:00
|
|
|
// TCHECK: [[A2_ADDR:%.+]] = alloca i{{[0-9]+}},
|
|
|
|
// TCHECK: [[B_ADDR:%.+]] = alloca [10 x float]*,
|
|
|
|
// TCHECK: [[C_ADDR:%.+]] = alloca [5 x [10 x double]]*,
|
|
|
|
// TCHECK: [[D_ADDR:%.+]] = alloca [[TT]]*,
|
2016-05-17 16:55:33 +08:00
|
|
|
// TCHECK-NOT: alloca i{{[0-9]+}},
|
2016-03-19 05:43:32 +08:00
|
|
|
// TCHECK: [[B_PRIV:%.+]] = alloca [10 x float],
|
|
|
|
// TCHECK: [[C_PRIV:%.+]] = alloca [5 x [10 x double]],
|
|
|
|
// TCHECK: [[D_PRIV:%.+]] = alloca [[TT]],
|
|
|
|
// TCHECK: store i{{[0-9]+}} [[A2_IN]], i{{[0-9]+}}* [[A2_ADDR]],
|
|
|
|
// TCHECK: store [10 x float]* [[B_IN]], [10 x float]** [[B_ADDR]],
|
|
|
|
// TCHECK: store [5 x [10 x double]]* [[C_IN]], [5 x [10 x double]]** [[C_ADDR]],
|
|
|
|
// TCHECK: store [[TT]]* [[D_IN]], [[TT]]** [[D_ADDR]],
|
|
|
|
// TCHECK: [[B_ADDR_REF:%.+]] = load [10 x float]*, [10 x float]** [[B_ADDR]],
|
2017-08-09 02:04:06 +08:00
|
|
|
// TCHECK: [[B_ADDR_REF:%.+]] = load [10 x float]*, [10 x float]** %
|
2016-03-19 05:43:32 +08:00
|
|
|
// TCHECK: [[C_ADDR_REF:%.+]] = load [5 x [10 x double]]*, [5 x [10 x double]]** [[C_ADDR]],
|
2017-08-09 02:04:06 +08:00
|
|
|
// TCHECK: [[C_ADDR_REF:%.+]] = load [5 x [10 x double]]*, [5 x [10 x double]]** %
|
2016-03-19 05:43:32 +08:00
|
|
|
// TCHECK: [[D_ADDR_REF:%.+]] = load [[TT]]*, [[TT]]** [[D_ADDR]],
|
2017-08-09 02:04:06 +08:00
|
|
|
// TCHECK: [[D_ADDR_REF:%.+]] = load [[TT]]*, [[TT]]** %
|
2016-03-19 05:43:32 +08:00
|
|
|
|
|
|
|
// firstprivate(aa): a_priv = a_in
|
|
|
|
|
|
|
|
// firstprivate(b): memcpy(b_priv,b_in)
|
|
|
|
// TCHECK: [[B_PRIV_BCAST:%.+]] = bitcast [10 x float]* [[B_PRIV]] to i8*
|
|
|
|
// TCHECK: [[B_ADDR_REF_BCAST:%.+]] = bitcast [10 x float]* [[B_ADDR_REF]] to i8*
|
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Summary:
Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
intrinsics. This change updates the Clang tests for this change.
The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.
This change removes the alignment argument in favour of placing the alignment
attribute on the source and destination pointers of the memory intrinsic call.
For example, code which used to read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
At this time the source and destination alignments must be the same (Step 1).
Step 2 of the change, to be landed shortly, will relax that contraint and allow
the source and destination to have different alignments.
llvm-svn: 322964
2018-01-20 01:12:54 +08:00
|
|
|
// TCHECK: call void @llvm.memcpy.{{.+}}(i8* align {{[0-9]+}} [[B_PRIV_BCAST]], i8* align {{[0-9]+}} [[B_ADDR_REF_BCAST]], {{.+}})
|
2016-03-19 05:43:32 +08:00
|
|
|
|
|
|
|
// firstprivate(c)
|
|
|
|
// TCHECK: [[C_PRIV_BCAST:%.+]] = bitcast [5 x [10 x double]]* [[C_PRIV]] to i8*
|
|
|
|
// TCHECK: [[C_IN_BCAST:%.+]] = bitcast [5 x [10 x double]]* [[C_ADDR_REF]] to i8*
|
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Summary:
Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
intrinsics. This change updates the Clang tests for this change.
The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.
This change removes the alignment argument in favour of placing the alignment
attribute on the source and destination pointers of the memory intrinsic call.
For example, code which used to read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
At this time the source and destination alignments must be the same (Step 1).
Step 2 of the change, to be landed shortly, will relax that contraint and allow
the source and destination to have different alignments.
llvm-svn: 322964
2018-01-20 01:12:54 +08:00
|
|
|
// TCHECK: call void @llvm.memcpy.{{.+}}(i8* align {{[0-9]+}} [[C_PRIV_BCAST]], i8* align {{[0-9]+}} [[C_IN_BCAST]],{{.+}})
|
2017-08-09 02:04:06 +08:00
|
|
|
|
2016-03-19 05:43:32 +08:00
|
|
|
// firstprivate(d)
|
|
|
|
// TCHECK: [[D_PRIV_BCAST:%.+]] = bitcast [[TT]]* [[D_PRIV]] to i8*
|
|
|
|
// TCHECK: [[D_IN_BCAST:%.+]] = bitcast [[TT]]* [[D_ADDR_REF]] to i8*
|
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Summary:
Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
intrinsics. This change updates the Clang tests for this change.
The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.
This change removes the alignment argument in favour of placing the alignment
attribute on the source and destination pointers of the memory intrinsic call.
For example, code which used to read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
At this time the source and destination alignments must be the same (Step 1).
Step 2 of the change, to be landed shortly, will relax that contraint and allow
the source and destination to have different alignments.
llvm-svn: 322964
2018-01-20 01:12:54 +08:00
|
|
|
// TCHECK: call void @llvm.memcpy.{{.+}}(i8* align {{[0-9]+}} [[D_PRIV_BCAST]], i8* align {{[0-9]+}} [[D_IN_BCAST]],{{.+}})
|
2016-03-19 05:43:32 +08:00
|
|
|
|
2017-08-09 02:04:06 +08:00
|
|
|
// TCHECK: load i16, i16* [[A2_ADDR]],
|
2016-05-17 16:55:33 +08:00
|
|
|
|
2017-08-09 02:04:06 +08:00
|
|
|
#pragma omp target firstprivate(ptr)
|
2016-03-19 05:43:32 +08:00
|
|
|
{
|
|
|
|
ptr[0]++;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TCHECK: define void @__omp_offloading_{{.+}}(double* [[PTR_IN:%.+]])
|
|
|
|
// TCHECK: [[PTR_ADDR:%.+]] = alloca double*,
|
2016-05-17 16:55:33 +08:00
|
|
|
// TCHECK-NOT: alloca double*,
|
2016-03-19 05:43:32 +08:00
|
|
|
// TCHECK: store double* [[PTR_IN]], double** [[PTR_ADDR]],
|
|
|
|
// TCHECK: [[PTR_IN_REF:%.+]] = load double*, double** [[PTR_ADDR]],
|
2016-05-17 16:55:33 +08:00
|
|
|
// TCHECK-NOT: store double* [[PTR_IN_REF]], double** [[PTR_PRIV]],
|
2016-03-19 05:43:32 +08:00
|
|
|
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2017-08-09 02:04:06 +08:00
|
|
|
template <typename tx>
|
2016-03-19 05:43:32 +08:00
|
|
|
tx ftemplate(int n) {
|
|
|
|
tx a = 0;
|
|
|
|
tx b[10];
|
|
|
|
|
2017-08-09 02:04:06 +08:00
|
|
|
#pragma omp target firstprivate(a, b)
|
2016-03-19 05:43:32 +08:00
|
|
|
{
|
|
|
|
a += 1;
|
|
|
|
b[2] += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2017-08-09 02:04:06 +08:00
|
|
|
static int fstatic(int n) {
|
2016-03-19 05:43:32 +08:00
|
|
|
int a = 0;
|
|
|
|
char aaa = 0;
|
|
|
|
int b[10];
|
|
|
|
|
2017-08-09 02:04:06 +08:00
|
|
|
#pragma omp target firstprivate(a, aaa, b)
|
2016-03-19 05:43:32 +08:00
|
|
|
{
|
|
|
|
a += 1;
|
|
|
|
aaa += 1;
|
|
|
|
b[2] += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2017-08-09 02:04:06 +08:00
|
|
|
// TCHECK: define {{.*}}void @__omp_offloading_{{.+}}(i{{[0-9]+}}{{.*}} [[A_IN:%.+]], i{{[0-9]+}}{{.*}} [[A3_IN:%.+]], [10 x i{{[0-9]+}}]*{{.+}} [[B_IN:%.+]])
|
2016-03-19 05:43:32 +08:00
|
|
|
// TCHECK: [[A_ADDR:%.+]] = alloca i{{[0-9]+}},
|
|
|
|
// TCHECK: [[A3_ADDR:%.+]] = alloca i{{[0-9]+}},
|
|
|
|
// TCHECK: [[B_ADDR:%.+]] = alloca [10 x i{{[0-9]+}}]*,
|
2016-05-17 16:55:33 +08:00
|
|
|
// TCHECK-NOT: alloca i{{[0-9]+}},
|
2016-03-19 05:43:32 +08:00
|
|
|
// TCHECK: [[B_PRIV:%.+]] = alloca [10 x i{{[0-9]+}}],
|
|
|
|
// TCHECK: store i{{[0-9]+}} [[A_IN]], i{{[0-9]+}}* [[A_ADDR]],
|
|
|
|
// TCHECK: store i{{[0-9]+}} [[A3_IN]], i{{[0-9]+}}* [[A3_ADDR]],
|
|
|
|
// TCHECK: store [10 x i{{[0-9]+}}]* [[B_IN]], [10 x i{{[0-9]+}}]** [[B_ADDR]],
|
|
|
|
// TCHECK: [[B_ADDR_REF:%.+]] = load [10 x i{{[0-9]+}}]*, [10 x i{{[0-9]+}}]** [[B_ADDR]],
|
2017-08-09 02:04:06 +08:00
|
|
|
// TCHECK: [[B_ADDR_REF:%.+]] = load [10 x i{{[0-9]+}}]*, [10 x i{{[0-9]+}}]** %
|
2016-03-19 05:43:32 +08:00
|
|
|
|
|
|
|
// firstprivate(a): a_priv = a_in
|
|
|
|
|
|
|
|
// firstprivate(aaa)
|
2016-05-17 16:55:33 +08:00
|
|
|
|
|
|
|
// TCHECK-NOT: store i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}*
|
2016-03-19 05:43:32 +08:00
|
|
|
|
|
|
|
// firstprivate(b)
|
|
|
|
// TCHECK: [[B_PRIV_BCAST:%.+]] = bitcast [10 x i{{[0-9]+}}]* [[B_PRIV]] to i8*
|
|
|
|
// TCHECK: [[B_IN_BCAST:%.+]] = bitcast [10 x i{{[0-9]+}}]* [[B_ADDR_REF]] to i8*
|
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Summary:
Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
intrinsics. This change updates the Clang tests for this change.
The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.
This change removes the alignment argument in favour of placing the alignment
attribute on the source and destination pointers of the memory intrinsic call.
For example, code which used to read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
At this time the source and destination alignments must be the same (Step 1).
Step 2 of the change, to be landed shortly, will relax that contraint and allow
the source and destination to have different alignments.
llvm-svn: 322964
2018-01-20 01:12:54 +08:00
|
|
|
// TCHECK: call void @llvm.memcpy.{{.+}}(i8* align {{[0-9]+}} [[B_PRIV_BCAST]], i8* align {{[0-9]+}} [[B_IN_BCAST]],{{.+}})
|
2016-03-19 05:43:32 +08:00
|
|
|
|
|
|
|
// TCHECK: ret void
|
|
|
|
|
|
|
|
struct S1 {
|
|
|
|
double a;
|
|
|
|
|
2017-08-09 02:04:06 +08:00
|
|
|
int r1(int n) {
|
|
|
|
int b = n + 1;
|
2016-03-19 05:43:32 +08:00
|
|
|
|
|
|
|
#pragma omp target firstprivate(b)
|
|
|
|
{
|
|
|
|
this->a = (double)b + 1.5;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (int)b;
|
|
|
|
}
|
|
|
|
|
2017-08-09 02:04:06 +08:00
|
|
|
// TCHECK: define internal void @__omp_offloading_{{.+}}([[S1]]* [[TH:%.+]], i{{[0-9]+}} [[B_IN:%.+]])
|
2016-03-19 05:43:32 +08:00
|
|
|
// TCHECK: [[TH_ADDR:%.+]] = alloca [[S1]]*,
|
|
|
|
// TCHECK: [[B_ADDR:%.+]] = alloca i{{[0-9]+}},
|
2016-05-17 16:55:33 +08:00
|
|
|
// TCHECK-NOT: alloca i{{[0-9]+}},
|
2016-03-19 05:43:32 +08:00
|
|
|
|
|
|
|
// TCHECK: store [[S1]]* [[TH]], [[S1]]** [[TH_ADDR]],
|
|
|
|
// TCHECK: store i{{[0-9]+}} [[B_IN]], i{{[0-9]+}}* [[B_ADDR]],
|
|
|
|
// TCHECK: [[TH_ADDR_REF:%.+]] = load [[S1]]*, [[S1]]** [[TH_ADDR]],
|
|
|
|
// TCHECK-64: [[B_ADDR_CONV:%.+]] = bitcast i{{[0-9]+}}* [[B_ADDR]] to i{{[0-9]+}}*
|
|
|
|
|
|
|
|
// firstprivate(b)
|
2016-05-17 16:55:33 +08:00
|
|
|
// TCHECK-NOT: store i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}*
|
2016-03-19 05:43:32 +08:00
|
|
|
|
|
|
|
// TCHECK: ret void
|
|
|
|
};
|
|
|
|
|
2017-08-09 02:04:06 +08:00
|
|
|
int bar(int n, double *ptr) {
|
2016-03-19 05:43:32 +08:00
|
|
|
int a = 0;
|
|
|
|
a += foo(n, ptr);
|
|
|
|
S1 S;
|
|
|
|
a += S.r1(n);
|
|
|
|
a += fstatic(n);
|
|
|
|
a += ftemplate<int>(n);
|
|
|
|
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
|
|
|
// template
|
|
|
|
|
2017-08-09 02:04:06 +08:00
|
|
|
// TCHECK: define internal void @__omp_offloading_{{.+}}(i{{[0-9]+}} [[A_IN:%.+]], [10 x i{{[0-9]+}}]*{{.+}} [[B_IN:%.+]])
|
2016-03-19 05:43:32 +08:00
|
|
|
// TCHECK: [[A_ADDR:%.+]] = alloca i{{[0-9]+}},
|
|
|
|
// TCHECK: [[B_ADDR:%.+]] = alloca [10 x i{{[0-9]+}}]*,
|
2016-05-17 16:55:33 +08:00
|
|
|
// TCHECK-NOT: alloca i{{[0-9]+}},
|
2016-03-19 05:43:32 +08:00
|
|
|
// TCHECK: [[B_PRIV:%.+]] = alloca [10 x i{{[0-9]+}}],
|
|
|
|
// TCHECK: store i{{[0-9]+}} [[A_IN]], i{{[0-9]+}}* [[A_ADDR]],
|
|
|
|
// TCHECK: store [10 x i{{[0-9]+}}]* [[B_IN]], [10 x i{{[0-9]+}}]** [[B_ADDR]],
|
|
|
|
// TCHECK: [[B_ADDR_REF:%.+]] = load [10 x i{{[0-9]+}}]*, [10 x i{{[0-9]+}}]** [[B_ADDR]],
|
2017-08-09 02:04:06 +08:00
|
|
|
// TCHECK: [[B_ADDR_REF:%.+]] = load [10 x i{{[0-9]+}}]*, [10 x i{{[0-9]+}}]** %
|
2016-03-19 05:43:32 +08:00
|
|
|
|
|
|
|
// firstprivate(a)
|
2016-05-17 16:55:33 +08:00
|
|
|
// TCHECK-NOT: store i{{[0-9]+}} %{{.+}}, i{{[0-9]+}}*
|
2016-03-19 05:43:32 +08:00
|
|
|
|
|
|
|
// firstprivate(b)
|
|
|
|
// TCHECK: [[B_PRIV_BCAST:%.+]] = bitcast [10 x i{{[0-9]+}}]* [[B_PRIV]] to i8*
|
|
|
|
// TCHECK: [[B_IN_BCAST:%.+]] = bitcast [10 x i{{[0-9]+}}]* [[B_ADDR_REF]] to i8*
|
Change memcpy/memove/memset to have dest and source alignment attributes (Step 1).
Summary:
Upstream LLVM is changing the the prototypes of the @llvm.memcpy/memmove/memset
intrinsics. This change updates the Clang tests for this change.
The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.
This change removes the alignment argument in favour of placing the alignment
attribute on the source and destination pointers of the memory intrinsic call.
For example, code which used to read:
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)
At this time the source and destination alignments must be the same (Step 1).
Step 2 of the change, to be landed shortly, will relax that contraint and allow
the source and destination to have different alignments.
llvm-svn: 322964
2018-01-20 01:12:54 +08:00
|
|
|
// TCHECK: call void @llvm.memcpy.{{.+}}(i8* align {{[0-9]+}} [[B_PRIV_BCAST]], i8* align {{[0-9]+}} [[B_IN_BCAST]],{{.+}})
|
2016-03-19 05:43:32 +08:00
|
|
|
|
|
|
|
// TCHECK: ret void
|
|
|
|
|
|
|
|
#endif
|
2018-01-09 04:09:47 +08:00
|
|
|
|
|
|
|
// TCHECK-DAG: distinct !DISubprogram(linkageName: "__omp_offloading_{{.+}}_worker",
|
|
|
|
// TCHECK-DAG: distinct !DISubprogram(linkageName: "__omp_offloading_{{.+}}_worker",
|
|
|
|
// TCHECK-DAG: distinct !DISubprogram(linkageName: "__omp_offloading_{{.+}}_worker",
|
|
|
|
// TCHECK-DAG: distinct !DISubprogram(linkageName: "__omp_offloading_{{.+}}_worker",
|
|
|
|
// TCHECK-DAG: distinct !DISubprogram(linkageName: "__omp_offloading_{{.+}}_worker",
|