Changes

Summary

  1. Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures (details)
  2. [mlir] Fix syntax example for tensor.from_elements (details)
  3. [lld] Fix small error in previous commit (details)
  4. [OpenMP] Change debugging symbol to weak_odr linkage (details)
  5. [OpenMP] Implement __assert_fail in the new device runtime (details)
  6. [OpenMP] Add additional fields to device environment (details)
  7. [OpenMP] Add support for dynamic shared memory in new RTL (details)
  8. Check for invalid projects passed in LLVM_ENABLE_PROJECTS (details)
Commit 6f7483b1ece4747f2aafe4baa05fc07e7dc9ed9d by akhuang
Reland "[LLD] Remove global state in lld/COFF" after fixing asan and msan test failures

Original commit description:

  [LLD] Remove global state in lld/COFF

  This patch removes globals from the lldCOFF library, by moving globals
  into a context class (COFFLinkingContext) and passing it around wherever
  it's needed.

  See https://lists.llvm.org/pipermail/llvm-dev/2021-June/151184.html for
  context about removing globals from LLD.

  I also haven't moved the `driver` or `config` variables yet.

  Differential Revision: https://reviews.llvm.org/D109634

This reverts commit a2fd05ada9030eab2258fff25e77a05adccae128.

Original commits were b4fa71eed34d967195514fe9b0a5211fca2bc5bc
and e03c7e367adb8f228332e3c2ef8f45484597b719.
The file was modifiedlld/include/lld/Common/Timer.h
The file was modifiedlld/COFF/PDB.h
The file was modifiedlld/COFF/MapFile.cpp
The file was modifiedlld/COFF/LTO.h
The file was modifiedlld/COFF/DLL.h
The file was modifiedlld/COFF/MapFile.h
The file was modifiedlld/COFF/TypeMerger.h
The file was modifiedlld/COFF/Driver.cpp
The file was modifiedlld/COFF/Writer.cpp
The file was modifiedlld/COFF/MarkLive.cpp
The file was modifiedlld/COFF/Driver.h
The file was modifiedlld/COFF/MinGW.h
The file was modifiedlld/COFF/Chunks.h
The file was modifiedlld/COFF/CallGraphSort.h
The file was modifiedlld/COFF/InputFiles.h
The file was modifiedlld/COFF/PDB.cpp
The file was modifiedlld/COFF/SymbolTable.h
The file was modifiedlld/COFF/CallGraphSort.cpp
The file was modifiedlld/COFF/ICF.cpp
The file was modifiedlld/COFF/MinGW.cpp
The file was addedlld/COFF/COFFLinkerContext.cpp
The file was modifiedlld/COFF/DLL.cpp
The file was addedlld/test/COFF/timers.ll
The file was modifiedlld/COFF/ICF.h
The file was modifiedlld/COFF/DebugTypes.h
The file was modifiedlld/COFF/CMakeLists.txt
The file was addedlld/COFF/COFFLinkerContext.h
The file was modifiedllvm/utils/gn/secondary/lld/COFF/BUILD.gn
The file was modifiedlld/COFF/MarkLive.h
The file was modifiedlld/COFF/DebugTypes.cpp
The file was modifiedlld/COFF/Chunks.cpp
The file was modifiedlld/COFF/LLDMapFile.h
The file was modifiedlld/COFF/Writer.h
The file was modifiedlld/COFF/LLDMapFile.cpp
The file was modifiedlld/COFF/LTO.cpp
The file was modifiedlld/COFF/SymbolTable.cpp
The file was modifiedlld/COFF/InputFiles.cpp
The file was modifiedlld/Common/Timer.cpp
Commit 2cda4f8ed798ecf061965b54976e427459514763 by github
[mlir] Fix syntax example for tensor.from_elements

Parens are not used here
The file was modifiedmlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
Commit 724a1dff8a8eabee4ca03036dd3efd84ecd8298a by akhuang
[lld] Fix small error in previous commit
6f7483b1ece4747f2aafe4baa05fc07e7dc9ed9d.
The file was modifiedlld/Common/Timer.cpp
Commit c30d7730ebde18d61b33ae1de9ded69dac6ea6be by jhuber6
[OpenMP] Change debugging symbol to weak_odr linkage

The new device runtime uses an internal variable to set debugging. This
variable was originally privately linked because every module will have
a copy of it. This caused problems with merging the device bitcode
library because it would get renamed and there was not a way to refer to
an external, private symbol. This changes the symbol to weak_odr so it
can be defined multiply, but will not be renamed.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D109997
The file was modifiedllvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
The file was modifiedclang/test/OpenMP/target_debug_codegen.cpp
Commit b266bcb13557f6a9fcf58a2d2be271a631aee72f by jhuber6
[OpenMP] Implement __assert_fail in the new device runtime

This patch implements the `__assert_fail` function in the new device
runtime. This allows users and developers to use the standars assert
function inside of the device.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D109886
The file was modifiedopenmp/libomptarget/DeviceRTL/include/Debug.h
The file was modifiedopenmp/libomptarget/DeviceRTL/src/Debug.cpp
Commit ec02c34b6df1efc643e5889bf3f181d55c4fed38 by jhuber6
[OpenMP] Add additional fields to device environment

This patch adds fields for the device number and number of devices into
the device environment struct and debugging values.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D110004
The file was modifiedopenmp/libomptarget/DeviceRTL/include/Configuration.h
The file was modifiedopenmp/libomptarget/deviceRTLs/common/device_environment.h
The file was modifiedopenmp/libomptarget/DeviceRTL/src/Configuration.cpp
The file was modifiedopenmp/libomptarget/plugins/cuda/src/rtl.cpp
Commit f1c821fa850b5168e0cc120f2497ac54d8ad325b by jhuber6
[OpenMP] Add support for dynamic shared memory in new RTL

This patch adds support for using dynamic shared memory in the new
device runtime. The new function `__kmpc_get_dynamic_shared` will return a
pointer to the buffer of dynamic shared memory. Currently the amount of memory
allocated is set by an environment variable.

In the future this amount will be added to the amount used for the smart stack
which will be configured in a similar way.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D110006
The file was modifiedopenmp/libomptarget/plugins/cuda/src/rtl.cpp
The file was modifiedopenmp/docs/design/Runtimes.rst
The file was modifiedopenmp/libomptarget/DeviceRTL/include/Configuration.h
The file was modifiedopenmp/libomptarget/DeviceRTL/include/State.h
The file was modifiedopenmp/libomptarget/DeviceRTL/include/Interface.h
The file was modifiedopenmp/libomptarget/DeviceRTL/src/Configuration.cpp
The file was modifiedopenmp/libomptarget/DeviceRTL/src/State.cpp
The file was addedopenmp/libomptarget/test/api/omp_dynamic_shared_memory.c
Commit 4121ac1e7f96d826b793bd7e29c181f1eb8168bf by joker.eph
Check for invalid projects passed in LLVM_ENABLE_PROJECTS

This is catching misconfiguration. For example one of my automation
had a typo running `-DLLVM_ENABLE_PROJECTS=nlir` and it was just
silently ignored. Instead, an error will now be displayed.

Differential Revision: https://reviews.llvm.org/D110016
The file was modifiedllvm/CMakeLists.txt