1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/lib
Michael Kruse 9bf95cf501 [clang][OpenMP] Use OpenMPIRBuilder for workshare loops.
Initial support for using the OpenMPIRBuilder by clang to generate loops using the OpenMPIRBuilder. This initial support is intentionally limited to:
 * Only the worksharing-loop directive.
 * Recognizes only the nowait clause.
 * No loop nests with more than one loop.
 * Untested with templates, exceptions.
 * Semantic checking left to the existing infrastructure.

This patch introduces a new AST node, OMPCanonicalLoop, which becomes parent of any loop that has to adheres to the restrictions as specified by the OpenMP standard. These restrictions allow OMPCanonicalLoop to provide the following additional information that depends on base language semantics:
 * The distance function: How many loop iterations there will be before entering the loop nest.
 * The loop variable function: Conversion from a logical iteration number to the loop variable.

These allow the OpenMPIRBuilder to act solely using logical iteration numbers without needing to be concerned with iterator semantics between calling the distance function and determining what the value of the loop variable ought to be. Any OpenMP logical should be done by the OpenMPIRBuilder such that it can be reused MLIR OpenMP dialect and thus by flang.

The distance and loop variable function are implemented using lambdas (or more exactly: CapturedStmt because lambda implementation is more interviewed with the parser). It is up to the OpenMPIRBuilder how they are called which depends on what is done with the loop. By default, these are emitted as outlined functions but we might think about emitting them inline as the OpenMPRuntime does.

For compatibility with the current OpenMP implementation, even though not necessary for the OpenMPIRBuilder, OMPCanonicalLoop can still be nested within OMPLoopDirectives' CapturedStmt. Although OMPCanonicalLoop's are not currently generated when the OpenMPIRBuilder is not enabled, these can just be skipped when not using the OpenMPIRBuilder in case we don't want to make the AST dependent on the EnableOMPBuilder setting.

Loop nests with more than one loop require support by the OpenMPIRBuilder (D93268). A simple implementation of non-rectangular loop nests would add another lambda function that returns whether a loop iteration of the rectangular overapproximation is also within its non-rectangular subset.

Reviewed By: jdenny

Differential Revision: https://reviews.llvm.org/D94973
2021-03-04 22:52:59 -06:00
..
Analysis [SampleFDO] Another fix to prevent repeated indirect call promotion in 2021-03-04 18:44:12 -08:00
AsmParser
BinaryFormat Revert "[DebugInfo] Add new instruction and DIExpression operator for variadic debug values" 2021-03-04 11:59:21 +00:00
Bitcode
Bitstream
CodeGen [XCOFF][DebugInfo] support DWARF for XCOFF for assembly output. 2021-03-04 21:07:52 -05:00
DebugInfo [PDB] Fix unsigned integer overflow 2021-02-26 11:26:53 -05:00
Demangle
DWARFLinker [llvm] Add assertions for the smart pointers with the possibility to be null in DWARFLinker::loadClangModule 2021-02-27 10:14:39 +03:00
ExecutionEngine [Orc] Fix MSVC error: conversion from 'initializer list' requires a narrowing 2021-03-02 15:34:36 +01:00
Extensions
FileCheck [FileCheck] Do not skip end of line in diagnostics 2021-03-03 08:20:39 +00:00
Frontend [clang][OpenMP] Use OpenMPIRBuilder for workshare loops. 2021-03-04 22:52:59 -06:00
Fuzzer
FuzzMutate
InterfaceStub
IR Move llvm/Analysis/ObjCARCUtil.h to IR to fix layering. 2021-03-04 16:14:53 -08:00
IRReader
LineEditor
Linker
LTO [IRSymTab] Set FB_used on llvm.compiler.used symbols 2021-03-03 16:22:30 -08:00
MC [XCOFF][DebugInfo] support DWARF for XCOFF for assembly output. 2021-03-04 21:07:52 -05:00
MCA [MCA] Add support for in-order CPUs 2021-03-04 14:08:19 +03:00
Object [IRSymTab] Set FB_used on llvm.compiler.used symbols 2021-03-03 16:22:30 -08:00
ObjectYAML
Option
Passes
ProfileData [SampleFDO] Another fix to prevent repeated indirect call promotion in 2021-03-04 18:44:12 -08:00
Remarks
Support Revert "[llvm-exegesis] Disable the LBR check on AMD" 2021-03-04 11:48:33 -05:00
TableGen
Target [RISCV] Enable fixed-length vectorization of LoopVectorizer for RISC-V Vector 2021-03-05 10:54:51 +08:00
Testing
TextAPI [lld-macho] Change loadReexport to handle the case where a TAPI re-exports to reference documents nested within other TBD. 2021-03-02 12:14:31 -05:00
ToolDrivers
Transforms [clang][OpenMP] Use OpenMPIRBuilder for workshare loops. 2021-03-04 22:52:59 -06:00
WindowsManifest
XRay
CMakeLists.txt