UnstableChanges

Summary

  1. Added openmp docs to SphinxDocsBuilder. (details)
Commit 786748274ad0b07093fed1422f49ca885c397c11 by alebedev
Added openmp docs to SphinxDocsBuilder.

Since openmp Sphinx docs are buildable, we can expand SphinxDocsBuilder to build and publish that as well.

Reviewed By: gkistanova, jdoerfert

Differential Revision: https://reviews.llvm.org/D88277
The file was modifiedzorg/buildbot/builders/SphinxDocsBuilder.py (diff)

Summary

  1. Sema: add support for `__attribute__((__swift_private__))` (details)
  2. Add the ability to write target stop-hooks using the ScriptInterpreter. (details)
  3. [AArch64][SVE] Drop "argmemonly" from gather/scatter with vector base. (details)
  4. [TRE][NFC] Refactor Basic Block Processing (details)
  5. C API: functions to get mask of a ShuffleVector (details)
  6. [LangRef] Clarify the behavior of memory access instructions when pointers/sizes aren't well-defined (details)
  7. [RISCV] Fix formatting (NFC) (details)
  8. [IR] Improve the description for Constant::isNormalFP to list all things that are not normal instead of just denormal. NFC (details)
  9. [Object][MachO] Refine the interface of Slice (details)
  10. [RISCV] Scheduler description for Bullet (details)
  11. [RISCV] Update driver tests (details)
  12. [lldb/bindings] Fix -Wformat after D88123 (details)
  13. [AArch64][GlobalISel] Add a few more vector type combinations for shift selection. (details)
  14. [LowerTypeTests][NewPM] Add constructor that uses command line flags (details)
  15. [AArch64][GlobalISel] If a G_BUILD_VECTOR operands are all G_CONSTANT then assign to gpr bank. (details)
  16. [Clang][OpenMP] Added support for nowait target in CodeGen via regular task (details)
  17. Common code preparation for tblgen-types patch (details)
  18. [bindings/go] Fix TestAttributes after D88241 (details)
  19. [Driver] Perform Linux distribution detection only once (details)
  20. [Driver] Fix formatting as suggested by clang-format (NFC) (details)
  21. [SelectionDAG] Add guard to automatically insert flags (details)
  22. [CodeGen] Do not call `emitGlobalConstantLargeInt` for constant requires 8 bytes to store (details)
Commit 58cdbf518b6ebaee59d0492375e2e8f7da87ca41 by Saleem Abdulrasool
Sema: add support for `__attribute__((__swift_private__))`

This attribute allows declarations to be restricted to the framework
itself, enabling Swift to remove the declarations when importing
libraries.  This is useful in the case that the functions can be
implemented in a more natural way for Swift.

This is based on the work of the original changes in
https://github.com/llvm/llvm-project-staging/commit/8afaf3aad2af43cfedca7a24cd817848c4e95c0c

Differential Revision: https://reviews.llvm.org/D87720
Reviewed By: Aaron Ballman
The file was addedclang/test/AST/attr-swift_private.m
The file was modifiedclang/include/clang/Basic/AttrDocs.td
The file was modifiedclang/include/clang/Basic/Attr.td
The file was modifiedclang/lib/Sema/SemaDeclAttr.cpp
The file was addedclang/test/SemaObjC/attr-swift_private.m
Commit b65966cff65bfb66de59621347ffd97238d3f645 by jingham
Add the ability to write target stop-hooks using the ScriptInterpreter.

Differential Revision: https://reviews.llvm.org/D88123
The file was modifiedlldb/source/Commands/CommandObjectTarget.cpp
The file was modifiedlldb/include/lldb/Target/Target.h
The file was modifiedlldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
The file was addedlldb/test/Shell/Commands/command-stop-hook-output.test
The file was addedlldb/test/Shell/Commands/Inputs/stop_hook.py
The file was modifiedlldb/include/lldb/Interpreter/ScriptInterpreter.h
The file was modifiedlldb/test/API/commands/target/stop-hooks/TestStopHooks.py
The file was modifiedlldb/include/lldb/Symbol/SymbolContext.h
The file was modifiedlldb/source/Symbol/SymbolContext.cpp
The file was modifiedlldb/bindings/python/python-swigsafecast.swig
The file was modifiedlldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
The file was modifiedlldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
The file was modifiedlldb/source/Target/Target.cpp
The file was addedlldb/test/API/commands/target/stop-hooks/stop_hook.py
The file was modifiedlldb/test/API/commands/target/stop-hooks/main.c
The file was modifiedlldb/source/Commands/Options.td
The file was addedlldb/test/API/commands/target/stop-hooks/TestStopHookScripted.py
The file was modifiedlldb/docs/use/python-reference.rst
The file was modifiedlldb/bindings/python/python-wrapper.swig
Commit 4600e210514281d2ac049e1c46d3f10bd17bf25c by efriedma
[AArch64][SVE] Drop "argmemonly" from gather/scatter with vector base.

The intrinsics don't have any pointer arguments, so "argmemonly" makes
optimizations think they don't write to memory at all.

Differential Revision: https://reviews.llvm.org/D88186
The file was modifiedllvm/include/llvm/IR/IntrinsicsAArch64.td
The file was modifiedllvm/test/Transforms/LICM/AArch64/sve-load-hoist.ll
Commit 48961ba0de3c556b092d434bd86583401495f101 by efriedma
[TRE][NFC] Refactor Basic Block Processing

Simplify and improve readability.

Differential Revision: https://reviews.llvm.org/D82269
The file was modifiedllvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
Commit 51cad041e0cb26597c7ccc0fbfaa349b8fffbcda by efriedma
C API: functions to get mask of a ShuffleVector

This commit fixes a regression (from LLVM 10 to LLVM 11 RC3) in the LLVM
C API.

Previously, commit 1ee6ec2bf removed the mask operand from the
ShuffleVector instruction, storing the mask data separately in the
instruction instead; this reduced the number of operands of
ShuffleVector from 3 to 2. AFAICT, this change unintentionally caused
a regression in the LLVM C API. Specifically, it is no longer possible
to get the mask of a ShuffleVector instruction through the C API. This
patch introduces new functions which together allow a C API user to get
the mask of a ShuffleVector instruction, restoring the functionality
which was previously available through LLVMGetOperand().

This patch also adds tests for this change to the llvm-c-test
executable, which involved adding support for InsertElement,
ExtractElement, and ShuffleVector itself (as well as constant vectors)
to echo.cpp. Previously, vector operations weren't tested at all in
echo.ll.

I also fixed some typos in comments and help-text nearby these changes,
which I happened to spot while developing this patch. Since the typo
fixes are technically unrelated other than being in the same files, I'm
happy to take them out if you'd rather they not be included in the patch.

Differential Revision: https://reviews.llvm.org/D88190
The file was modifiedllvm/tools/llvm-c-test/main.c
The file was modifiedllvm/lib/IR/Core.cpp
The file was modifiedllvm/tools/llvm-c-test/echo.cpp
The file was modifiedllvm/include/llvm-c/Core.h
The file was modifiedllvm/test/Bindings/llvm-c/echo.ll
Commit 8bd205bf1de486a32abd956390f6527da4c13e33 by aqjune
[LangRef] Clarify the behavior of memory access instructions when pointers/sizes aren't well-defined

This is a patch to LangRef that clarifies the behavior of load/store/memset/memcpy/memmove when the pointers or sizes are not well-defined
as well.

MSan detects a case when e.g., only lower bits of address are garbage when `-msan-check-access-address` is enabled, and it does not directly conflict with this patch because a C program should not use a pointer with undef bits and reasonable optimizations do not convert a well-defined pointer into a pointer with undef bits.

This patch contains a definition of a well-defined value as well.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D87994
The file was modifiedllvm/docs/LangRef.rst
Commit 0291c471aad4bf8422405586e2bf80cb8df25980 by ebahapo
[RISCV] Fix formatting (NFC)
The file was modifiedllvm/lib/Target/RISCV/RISCVSchedule.td
The file was modifiedllvm/lib/Target/RISCV/RISCVSchedRocket.td
The file was modifiedllvm/lib/Target/RISCV/RISCV.td
Commit b5f46534c4dd5ac32bc3b63685de1d66eec96595 by craig.topper
[IR] Improve the description for Constant::isNormalFP to list all things that are not normal instead of just denormal. NFC
The file was modifiedllvm/include/llvm/IR/Constant.h
Commit 97702c3d9234ddc7dd39d4d107c8bec8765746ce by alexshap
[Object][MachO] Refine the interface of Slice

This patch performs a minor cleanup of the class Slice:
static methods and constructors which take a pointer but assume that
it's not null now take the argument by reference.
NFC.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D88320
The file was modifiedllvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
The file was modifiedllvm/lib/Object/MachOUniversalWriter.cpp
The file was modifiedllvm/include/llvm/Object/MachOUniversalWriter.h
The file was modifiedllvm/tools/llvm-lipo/llvm-lipo.cpp
Commit 764c1b7a4db1606438c8daea13c9d2a18190a865 by ebahapo
[RISCV] Scheduler description for Bullet

Add the pipeline model for the RISC-V Bullet micro architecture.

Co-authored-by: Evandro Menezes <evandro.menezes@sifive.com>
The file was modifiedllvm/include/llvm/Support/RISCVTargetParser.def
The file was addedllvm/lib/Target/RISCV/RISCVSchedBullet.td
The file was modifiedllvm/lib/Target/RISCV/RISCV.td
Commit a000580a89718a1ff27a3129e34367b9a3fa1730 by ebahapo
[RISCV] Update driver tests

Add the RISC-V Bullet core to the driver tests.
The file was modifiedclang/test/Misc/target-invalid-cpu-note.c
The file was modifiedclang/test/Driver/riscv-cpus.c
Commit 67782a0f99c6a792c9d60267d42b21f7335814ba by i
[lldb/bindings] Fix -Wformat after D88123
The file was modifiedlldb/bindings/python/python-wrapper.swig
Commit 2dba5461be2d1b35e8461a60a2149281b42fea48 by Amara Emerson
[AArch64][GlobalISel] Add a few more vector type combinations for shift selection.
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-vector-shift.mir
Commit 83e3ea2cfce69d2b2b4b831ca78335c349df4fdd by aeubanks
[LowerTypeTests][NewPM] Add constructor that uses command line flags

This matches the legacy PM pass by having one constructor use command
line flags, and the other use parameters to the pass.

This fixes all tests under Transforms/LowerTypeTests using NPM.

Reviewed By: ychen, pcc

Differential Revision: https://reviews.llvm.org/D87845
The file was modifiedllvm/test/Transforms/LowerTypeTests/simple.ll
The file was modifiedllvm/lib/Passes/PassRegistry.def
The file was modifiedllvm/include/llvm/Transforms/IPO/LowerTypeTests.h
The file was modifiedllvm/lib/Transforms/IPO/LowerTypeTests.cpp
Commit 546e460a00a985ce6fca323fe509f7d4e893b621 by Amara Emerson
[AArch64][GlobalISel] If a G_BUILD_VECTOR operands are all G_CONSTANT then assign to gpr bank.

Even if the type is s8/s16, assigning to gpr is preferable with constants because
worst case we can select via a constant pool load, and without cross-bank copies
to the FPR bank more patterns can be imported later.
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/regbankselect-build-vector.mir
The file was modifiedllvm/test/CodeGen/AArch64/arm64-vabs.ll
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp
Commit ebb1092a2875739d3e9bb6b1fb230c0e0d88ebff by tianshilei1992
[Clang][OpenMP] Added support for nowait target in CodeGen via regular task

Previously for nowait target, CG emitted a function call to `__tgt_target_nowait`, etc. However, in OpenMP RTL, these functions just directly call the no-nowait version, which means nowait is not working as expected.

OpenMP specification says a target is acutally a target task, which is an untied and detachable task. It is natural to go to the direction that generates a task for a nowait target. However, OpenMP task has a problem that it must be within to a parallel region; otherwise the task will be executed immediately. As a result, if we directly wrap to a regular task, the `target nowait` outside of a parallel region is still a synchronous version.

In D77609, I added the support for unshackled task in OpenMP RTL. Basically, unshackled task is a task that is not bound to any parallel region. So all nowait target will be tranformed into an unshackled task. In order to distinguish from regular task, a new flag bit is set for unshackled task. This flag will be used by RTL for later process.

Since all target tasks are allocated via `__kmpc_omp_target_task_alloc`, and in current `libomptarget`, `__kmpc_omp_target_task_alloc` just calls `__kmpc_omp_task_alloc`. Therefore, we can modify the flag in `__kmpc_omp_target_task_alloc` so that we don't need to modify the FE too much. If users choose to opt out the feature, they just need to use a RTL w/o support of unshackled threads.

As a result, in this patch, the `target nowait` region is simply wrapped into a regular task. Later once we have RTL support for unshackled tasks, the wrapped tasks can be executed by unshackled threads w/o changes in the FE.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D78075
The file was modifiedclang/test/OpenMP/target_parallel_for_codegen.cpp
The file was modifiedclang/test/OpenMP/target_parallel_codegen.cpp
The file was modifiedclang/test/OpenMP/target_simd_codegen.cpp
The file was modifiedclang/test/OpenMP/declare_mapper_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_codegen.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_simd_codegen.cpp
The file was modifiedclang/lib/CodeGen/CGOpenMPRuntime.cpp
The file was modifiedclang/test/OpenMP/target_teams_distribute_codegen.cpp
The file was modifiedclang/test/OpenMP/target_parallel_for_simd_codegen.cpp
The file was modifiedclang/test/OpenMP/target_codegen.cpp
Commit 76419525fba62c93d5c337acdb0b80d6e42b00c9 by joker.eph
Common code preparation for tblgen-types patch

Cleanup and add methods which https://reviews.llvm.org/D86904 requires. Breaking up to lower review load.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D88267
The file was modifiedllvm/include/llvm/TableGen/Record.h
The file was modifiedmlir/include/mlir/TableGen/Operator.h
The file was modifiedllvm/lib/TableGen/Record.cpp
The file was addedmlir/include/mlir/TableGen/CodeGenHelpers.h
The file was modifiedmlir/lib/TableGen/Operator.cpp
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
The file was modifiedmlir/tools/mlir-tblgen/DialectGen.cpp
Commit 63c58c2b934525c9863e624cf39ec542dd84ca78 by i
[bindings/go] Fix TestAttributes after D88241
The file was modifiedllvm/bindings/go/llvm/ir_test.go
Commit 96318f64a7864747ebbb4e33cb75b0dea465abfc by dmantipov
[Driver] Perform Linux distribution detection only once

Differential Revision: https://reviews.llvm.org/D87187
The file was modifiedclang/include/clang/Driver/Distro.h
The file was modifiedclang/lib/Driver/Distro.cpp
Commit 2ca0ea15e5c910ff93874679f0a03c923fe85e5b by dmantipov
[Driver] Fix formatting as suggested by clang-format (NFC)
The file was modifiedclang/include/clang/Driver/Distro.h
Commit c0f8e4c06c85db256806cfce90a2b49e4cdd58d4 by qiucofan
[SelectionDAG] Add guard to automatically insert flags

This is like FastMathFlagGuard in IR. Since we use SDAG instance to get
values, it's with SelectionDAG. By creating a FlagInserter in current
scope, all values created by getNode will get the flags if no Flags
argument provided.

In this patch, I applied it to floating point operations folding part in
DAG combiner, and removed Flags passing to getNode to show its effect.
Other places in DAG combiner and other helper methods similar to getNode
also need this. They can be done in follow-up patches.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D87361
The file was modifiedllvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
The file was modifiedllvm/test/CodeGen/X86/sqrt-fastmath-mir.ll
The file was modifiedllvm/include/llvm/CodeGen/SelectionDAG.h
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit c6c5629f2fb4ddabd376fbe7c218733283e91d09 by simon
[CodeGen] Do not call `emitGlobalConstantLargeInt` for constant requires 8 bytes to store

This is a fix for PR47630. The regression is caused by the D78011. After
this change the code starts to call the `emitGlobalConstantLargeInt` even
for constants which requires eight bytes to store.

Differential revision: https://reviews.llvm.org/D88261
The file was modifiedllvm/test/CodeGen/Mips/emit-big-cst.ll
The file was modifiedllvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Summary

  1. Added openmp docs to SphinxDocsBuilder. (details)
Commit 786748274ad0b07093fed1422f49ca885c397c11 by alebedev
Added openmp docs to SphinxDocsBuilder.

Since openmp Sphinx docs are buildable, we can expand SphinxDocsBuilder to build and publish that as well.

Reviewed By: gkistanova, jdoerfert

Differential Revision: https://reviews.llvm.org/D88277
The file was modifiedzorg/buildbot/builders/SphinxDocsBuilder.py