Jenkins is going to shut down

SuccessChanges

Summary

  1. [mlir] Initial version of C APIs (details)
  2. [clang] Add -fno-delayed-template-parsing to the added unit tests in DeclPrinterTest.cpp (details)
  3. [Statepoints] Operand folding in presense of tied registers. (details)
  4. [OpenMP] Fix `present` for exit from `omp target data` (details)
  5. [OpenMP][Docs] Add map clause reordering status as unclaimed (details)
  6. [OpenMP][Docs] Mark `present` map type modifier as done (details)
  7. [OpenMP] Fix `omp target update` for array extension (details)
Commit 75f239e9756b157f209412268c5a50a69b1a4e74 by zinenko
[mlir] Initial version of C APIs

    Introduce an initial version of C API for MLIR core IR components: Value, Type,
    Attribute, Operation, Region, Block, Location. These APIs allow for both
    inspection and creation of the IR in the generic form and intended for wrapping
    in high-level library- and language-specific constructs. At this point, there
    is no stability guarantee provided for the API.

Reviewed By: stellaraccident, lattner

Differential Revision: https://reviews.llvm.org/D83310
The file was addedmlir/docs/CAPI.md
The file was addedmlir/test/CAPI/ir.c
The file was addedmlir/include/mlir-c/Registration.h
The file was addedmlir/lib/CAPI/Registration/CMakeLists.txt
The file was modifiedmlir/CMakeLists.txt (diff)
The file was addedmlir/test/CAPI/lit.local.cfg
The file was addedmlir/lib/CAPI/CMakeLists.txt
The file was modifiedmlir/test/CMakeLists.txt (diff)
The file was addedmlir/lib/CAPI/IR/CMakeLists.txt
The file was addedmlir/test/CAPI/CMakeLists.txt
The file was addedmlir/lib/CAPI/Registration/Registration.cpp
The file was modifiedmlir/test/lit.cfg.py (diff)
The file was addedmlir/include/mlir-c/IR.h
The file was addedmlir/lib/CAPI/IR/IR.cpp
Commit 4dcbb9cef71afa549afe8f6b4d335b1c996f8079 by riccibrun
[clang] Add -fno-delayed-template-parsing to the added unit tests in DeclPrinterTest.cpp
The file was modifiedclang/unittests/AST/DeclPrinterTest.cpp (diff)
Commit d21ce408218150e23b5cc4af45c088c0926d7e18 by dantrushin
[Statepoints] Operand folding in presense of tied registers.

Implement proper folding of statepoint meta operands (deopt and GC)
when statepoint uses tied registers.
For deopt operands it is just about properly preserving tiedness
in new instruction.
For tied GC operands folding is a little bit more tricky.
We can fold tied GC operands only from InlineSpiller, because it knows
how to properly reload tied def after it was turned into memory operand.
Other users (e.g. peephole) cannot properly fold such operands as they
do not know how (or when) to reload them from memory.
We do this by un-tieing operand we want to fold in InlineSpiller
and allowing to fold only untied operands in foldPatchpoint.
The file was modifiedllvm/lib/CodeGen/TargetInstrInfo.cpp (diff)
The file was addedllvm/test/CodeGen/X86/statepoint-vreg-folding.mir
The file was modifiedllvm/lib/CodeGen/InlineSpiller.cpp (diff)
Commit 002d61db2b7790dc884953bf9271878bf0af3a8e by jdenny.ornl
[OpenMP] Fix `present` for exit from `omp target data`

Without this patch, the following example fails but shouldn't
according to OpenMP TR8:

```
#pragma omp target enter data map(alloc:i)
#pragma omp target data map(present, alloc: i)
{
   #pragma omp target exit data map(delete:i)
} // fails presence check here
```

OpenMP TR8 sec. 2.22.7.1 "map Clause", p. 321, L23-26 states:

> If the map clause appears on a target, target data, target enter
> data or target exit data construct with a present map-type-modifier
> then on entry to the region if the corresponding list item does not
> appear in the device data environment an error occurs and the
> program terminates.

There is no corresponding statement about the exit from a region.
Thus, the `present` modifier should:

1. Check for presence upon entry into any region, including a `target
   exit data` region.  This behavior is already implemented correctly.

2. Should not check for presence upon exit from any region, including
   a `target` or `target data` region.  Without this patch, this
   behavior is not implemented correctly, breaking the above example.

In the case of `target data`, this patch fixes the latter behavior by
removing the `present` modifier from the map types Clang generates for
the runtime call at the end of the region.

In the case of `target`, we have not found a valid OpenMP program for
which such a fix would matter.  It appears that, if a program can
guarantee that data is present at the beginning of a `target` region
so that there's no error there, that data is also guaranteed to be
present at the end.  This patch adds a comment to the runtime to
document this case.

Reviewed By: grokos, RaviNarayanaswamy, ABataev

Differential Revision: https://reviews.llvm.org/D84422
The file was modifiedclang/test/OpenMP/target_data_codegen.cpp (diff)
The file was modifiedclang/lib/CodeGen/CGStmtOpenMP.cpp (diff)
The file was addedopenmp/libomptarget/test/mapping/present/target_data_at_exit.c
The file was modifiedclang/lib/CodeGen/CGOpenMPRuntime.cpp (diff)
The file was modifiedopenmp/libomptarget/src/omptarget.cpp (diff)
The file was modifiedclang/lib/CodeGen/CGOpenMPRuntime.h (diff)
Commit 26cf9c17044515cdde3e7baeea843001ba33be59 by jdenny.ornl
[OpenMP][Docs] Add map clause reordering status as unclaimed
The file was modifiedclang/docs/OpenMPSupport.rst (diff)
Commit 03bb545b68c2edb9dc5bd092104bdb83a8e5e347 by jdenny.ornl
[OpenMP][Docs] Mark `present` map type modifier as done
The file was modifiedclang/docs/OpenMPSupport.rst (diff)
Commit 5ab43989c353a2378910d20c7b88e44ea92b3aee by jdenny.ornl
[OpenMP] Fix `omp target update` for array extension

OpenMP TR8 sec. 2.15.6 "target update Construct", p. 183, L3-4 states:

> If the corresponding list item is not present in the device data
> environment and there is no present modifier in the clause, then no
> assignment occurs to or from the original list item.

L10-11 states:

> If a present modifier appears in the clause and the corresponding
> list item is not present in the device data environment then an
> error occurs and the program termintates.

(OpenMP 5.0 also has the first passage but without mention of the
present modifier of course.)

In both passages, I assume "is not present" includes the case of
partially but not entirely present.  However, without this patch, the
target update directive misbehaves in this case both with and without
the present modifier.  For example:

```
#pragma omp target enter data map(to:arr[0:3])
#pragma omp target update to(arr[0:5]) // might fail on data transfer
#pragma omp target update to(present:arr[0:5]) // might fail on data transfer
```

The problem is that `DeviceTy::getTgtPtrBegin` does not return a null
pointer in that case, so `target_data_update` sees the data as fully
present, and the data transfer then might fail depending on the target
device.  However, without the present modifier, there should never be
a failure.  Moreover, with the present modifier, there should always
be a failure, and the diagnostic should mention the present modifier.

This patch fixes `DeviceTy::getTgtPtrBegin` to return null when
`target_data_update` is the caller.  I'm wondering if it should do the
same for more callers.

Reviewed By: grokos, jdoerfert

Differential Revision: https://reviews.llvm.org/D85246
The file was modifiedopenmp/libomptarget/src/device.h (diff)
The file was addedopenmp/libomptarget/test/mapping/present/target_update_array_extension.c
The file was modifiedopenmp/libomptarget/src/omptarget.cpp (diff)
The file was addedopenmp/libomptarget/test/mapping/target_update_array_extension.c
The file was modifiedopenmp/libomptarget/src/device.cpp (diff)