From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7AA073858C52; Wed, 18 May 2022 10:02:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AA073858C52 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105640] [OpenMP] Context selectors missing for PowerPC Date: Wed, 18 May 2022 10:02:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2022 10:02:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105640 --- Comment #5 from Tobias Burnus --- Regarding LLVM, I have no idea, but doing some searching, I do see: * clang/test/OpenMP/declare_variant_clauses_ast_print.cpp: //PRINT: #pragma omp declare variant(foo_v2) match(construct=3D{dispatch}, device=3D{arch(ppc)}) adjust_args(need_device_ptr:AAA) * clang/test/OpenMP/declare_variant_messages.c: #pragma omp begin declare variant match(device=3D{isa(sse2020), arch(ppc)}) * * * Otherwise, the following archs are supported according to llvm/include/llvm/Frontend/OpenMP/OMPKinds.def: __OMP_TRAIT_PROPERTY(device, arch, arm) __OMP_TRAIT_PROPERTY(device, arch, armeb) __OMP_TRAIT_PROPERTY(device, arch, aarch64) __OMP_TRAIT_PROPERTY(device, arch, aarch64_be) __OMP_TRAIT_PROPERTY(device, arch, aarch64_32) __OMP_TRAIT_PROPERTY(device, arch, ppc) __OMP_TRAIT_PROPERTY(device, arch, ppcle) __OMP_TRAIT_PROPERTY(device, arch, ppc64) __OMP_TRAIT_PROPERTY(device, arch, ppc64le) __OMP_TRAIT_PROPERTY(device, arch, x86) __OMP_TRAIT_PROPERTY(device, arch, x86_64) __OMP_TRAIT_PROPERTY(device, arch, amdgcn) __OMP_TRAIT_PROPERTY(device, arch, nvptx) __OMP_TRAIT_PROPERTY(device, arch, nvptx64) It is not quite clear what is permitted as ISA. That file has: OMP_TRAIT_PROPERTY(device_isa___ANY, device, device_isa, "") and later in the .cc code: // We overwrite the isa trait as it is actually up to the OMPContext ho= ok to // check the raw string(s). if (Property =3D=3D TraitProperty::device_isa___ANY) IsActiveTrait =3D llvm::all_of(VMI.ISATraits, [&](StringRef RawString= ) { return Ctx.matchesISATrait(RawString); which in turn uses: bool TargetOMPContext::matchesISATrait(StringRef RawString) const { auto It =3D FeatureMap.find(RawString); if (It !=3D FeatureMap.end()) return It->second; if (!FeatureValidityCheck(RawString)) DiagUnknownTrait(RawString); return false; which in turn is initialized via void ASTContext::getFunctionFeatureMap(llvm::StringMap &FeatureMap, const FunctionDecl *FD) const { if (FD) getFunctionFeatureMap(FeatureMap, GlobalDecl().getWithDecl(FD)); else Target->initFeatureMap(FeatureMap, getDiagnostics(), Target->getTargetOpts().CPU, Target->getTargetOpts().Features); } In my understanding, that matches: clang/lib/Basic/Targets/NVPTX.h: Features[CudaArchToString(GPU)] =3D t= rue; clang/lib/Basic/Targets/NVPTX.h: Features["ptx" + std::to_string(PTXVersion)] =3D true; where the former comes from static const CudaArchToStringMap arch_names in clang/lib/Basic/Cuda.cpp and for PowerPC, there is clang/lib/Basic/Targets/PPC.cpp=