Re: [PATCH] [OPENMP] Codegen of the ‘aligned’ clause for the ‘omp simd’ directive
hfinkel at anl.gov
hfinkel at anl.gov
Fri Sep 26 10:26:57 PDT 2014
================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:7180
@@ +7179,3 @@
+def warn_omp_alignment_not_power_of_two : Warning<
+ "requested alignment value is not power of 2 - ignored">,
+ InGroup<OpenMPClauses>;
----------------
I don't like the " - ignored" part, how about rewording like this:
"aligned clause will be ignored because the requested alignment is not a power of 2"
================
Comment at: lib/CodeGen/CGStmtOpenMP.cpp:53
@@ +52,3 @@
+ const OMPAlignedClause &Clause,
+ unsigned Safelen = 2) {
+ unsigned ClauseAlignment = 0;
----------------
Remove this (see below).
================
Comment at: lib/CodeGen/CGStmtOpenMP.cpp:76
@@ +75,3 @@
+ if (Ty->isBuiltinType())
+ Ty = C.getVectorType(QualType(Ty, 0), Safelen,
+ VectorType::GenericVector).getTypePtr();
----------------
I don't think that using Safelen here is the right thing to do; a loop can have a very large safelen without that implying anything about the alignment of the pointers.
The right thing to do here is to use a callback into TargetCodeGenInfo (which you can get at using the TheTargetCodeGenInfo global).
================
Comment at: lib/CodeGen/CGStmtOpenMP.cpp:105
@@ +104,3 @@
+ case OMPC_aligned: {
+ // FIXME: Passing safelen.
+ EmitOMPAlignedClause(*this, cast<OMPAlignedClause>(*C));
----------------
Remove the FIXME.
http://reviews.llvm.org/D5499
More information about the cfe-commits
mailing list