Changes

Summary

  1. [sanitizer] Remove disabled line (details)
  2. [sanitizer] Fix COMPILER_RT_DEBUG assignment (details)
  3. Added missing comma in clang-ppc64le-rhel builder configuration. (details)
  4. [sanitizer][NFC] Reuse cmake setup (details)
  5. [sanitizer] Fix asan builder name (details)
  6. [sanitizer] Remove unused GN reference (details)
  7. [sanitizer] Add dedicated QEMU builder (details)
Commit ac6a7e6e071c77bc081de358266075a938a11e39 by Vitaly Buka
[sanitizer] Remove disabled line
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_qemu.sh (diff)
Commit 76d050f0ff7e2517953936571ced397817a4a2e0 by Vitaly Buka
[sanitizer] Fix COMPILER_RT_DEBUG assignment
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_qemu.sh (diff)
Commit 8bbdd35de2d2a8513bbe4f62250ca1cf8f0a38fd by gkistanova
Added missing comma in clang-ppc64le-rhel builder configuration.
The file was modifiedbuildbot/osuosl/master/config/builders.py (diff)
Commit 1d14b1b88e1b3b85b286e855a61813991d8d8d3b by Vitaly Buka
[sanitizer][NFC] Reuse cmake setup
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_qemu.sh (diff)
Commit 91a7eff07ec1801011fc2e171ba2ec55108abc82 by Vitaly Buka
[sanitizer] Fix asan builder name
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_selector.py (diff)
The file was modifiedbuildbot/osuosl/master/config/builders.py (diff)
Commit 594bf9c4e3d7ddb82ad88b3f809f586c35417d05 by Vitaly Buka
[sanitizer] Remove unused GN reference
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_selector.py (diff)
Commit 8d4ef0058071a232fd2a03f78194a167c3815f87 by Vitaly Buka
[sanitizer] Add dedicated QEMU builder
The file was modifiedbuildbot/osuosl/master/config/builders.py (diff)
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_selector.py (diff)

Summary

  1. [Inliner] Copy attributes when deoptimize intrinsic is inlined (details)
  2. [Polly] Add support for -polly-dump-after(-file) with the NPM. (details)
  3. Revert "[ADT] Add new type traits for type pack indexes" (details)
  4. Revert "[LV] Unconditionally branch from middle to scalar preheader if the scalar loop must execute (try 3)" (details)
  5. [lld][WebAssembly] Refactor input chunk class hierarchy. NFC (details)
  6. [PowerPC] only check the load instruction result number 0. (details)
  7. [GVN] Improve analysis for missed optimization remark (details)
  8. [lld][MachO] Adjust isCodeSection signature (details)
  9. [Statepoint Lowering] Cleanup: remove unused option statepoint-always-spill-base. (details)
  10. [AMDGPU][libomptarget] Remove unused global variables (details)
  11. [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1 (details)
  12. [AMDGPU][Libomptarget] Rename & move g_executables to private (details)
Commit 7bed58d28fd0ec476d5cb5ec2d73416207f250bc by serguei.katkov
[Inliner] Copy attributes when deoptimize intrinsic is inlined

During inlining of call-site with deoptimize intrinsic callee we miss
attributes set on this call site. As a result attributes like deopt-lowering are
disappeared resulting in inefficient behavior of register allocator in codegen.

Just copy attributes for deoptimize call like we do for others calls.

Reviewers: reames, apilipenko
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D102602
The file was modifiedllvm/lib/Transforms/Utils/InlineFunction.cpp
The file was addedllvm/test/Transforms/Inline/deoptimize-intrinsic-attrs.ll
Commit ad568f4286c9a46e81475aee4ff9ecfe082e2ec0 by llvm-project
[Polly] Add support for -polly-dump-after(-file) with the NPM.

For the same reason as with -polly-dump-before, it is only supported
with -polly-position=early.
The file was modifiedpolly/lib/Support/RegisterPasses.cpp
The file was modifiedpolly/test/Support/dumpmodule.ll
Commit 2d1f2ba7d51689de231794cf3dd74257aeccd315 by stilis
Revert "[ADT] Add new type traits for type pack indexes"

This reverts commit a6d3987b8ef3b7616f0835b89515c4264f2a7a64.
The file was modifiedllvm/unittests/ADT/STLExtrasTest.cpp
The file was modifiedllvm/include/llvm/ADT/PointerUnion.h
The file was modifiedllvm/include/llvm/ADT/STLExtras.h
Commit ed9d70781bbd1dc858b9f6913729fcc49a1e4bdf by listmail
Revert "[LV] Unconditionally branch from middle to scalar preheader if the scalar loop must execute (try 3)"

This reverts commit 6d3e3ae8a9ca10e063d541a959f4fe4cdb003dba.

Still seeing PPC build bot failures, and one arm self host bot failing.  I'm officially stumped, and need help from a bot owner to reduce.
The file was modifiedllvm/test/Transforms/LoopVectorize/ARM/mve-gather-scatter-tailpred.ll
The file was modifiedllvm/test/Transforms/LoopVectorize/loop-form.ll
The file was modifiedllvm/test/Transforms/LoopVectorize/first-order-recurrence-complex.ll
The file was modifiedllvm/lib/Transforms/Utils/LoopVersioning.cpp
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
The file was modifiedllvm/test/Transforms/LoopVectorize/interleaved-accesses.ll
Commit 5a9b25e15b4f9707245bb9d1ab56ab99b725505a by sbc
[lld][WebAssembly] Refactor input chunk class hierarchy. NFC

The main motivation for this refactor is to remove the subclass
relationship between the InputSegment and MergeInputSegment and
SyntenticMergedInputSegment so that we can use the merging classes for
debug sections which are not data segments.

In the process of refactoring I also remove all the virtual functions
from the class hierarchy and try to reuse techniques used in the ELF
linker (see `lld/ELF/InputSections.h`).

Differential Revision: https://reviews.llvm.org/D102546
The file was modifiedlld/wasm/Writer.cpp
The file was modifiedlld/wasm/OutputSections.cpp
The file was modifiedlld/wasm/SymbolTable.h
The file was modifiedlld/wasm/Driver.cpp
The file was modifiedlld/wasm/OutputSegment.cpp
The file was modifiedlld/wasm/OutputSegment.h
The file was modifiedlld/wasm/SymbolTable.cpp
The file was modifiedlld/wasm/Symbols.cpp
The file was modifiedlld/wasm/InputChunks.h
The file was modifiedlld/wasm/InputChunks.cpp
The file was modifiedlld/wasm/InputFiles.cpp
The file was modifiedlld/wasm/Symbols.h
The file was modifiedlld/wasm/SyntheticSections.cpp
The file was modifiedlld/wasm/InputFiles.h
Commit 15d4ed6d8c6956efcb2d5afb89bea7f0fff6f989 by czhengsz
[PowerPC] only check the load instruction result number 0.

Reviewed By: nemanjai

Differential Revision: https://reviews.llvm.org/D102596
The file was modifiedllvm/test/CodeGen/PowerPC/vsx-shuffle-le-load.ll
The file was modifiedllvm/lib/Target/PowerPC/PPCISelLowering.cpp
Commit ab1f6ffa566ba1f6c7994da130380e6f258f580c by anemet
[GVN] Improve analysis for missed optimization remark

This change tries to handle multiple dominating users of the pointer operand
by choosing the most immediately dominating one, if possible.  While making
this change I also found that the previous implementation had a missing break
statement, making all loads with an odd number of dominating users emit an
OtherAccess value, so that has also been fixed.

Patch by Henrik G Olsson!

Differential Revision: https://reviews.llvm.org/D79097
The file was addedllvm/test/Transforms/GVN/opt-remarks-multiple-users.ll
The file was modifiedllvm/lib/Transforms/Scalar/GVN.cpp
The file was addedllvm/test/Transforms/GVN/opt-remarks-non-dominating.ll
Commit dc2c6cf2749fb1655839704a184067d1c6b48ee5 by alexshap
[lld][MachO] Adjust isCodeSection signature

This diff changes the type of the argument of isCodeSection to const InputSection *.
NFC.

Test plan: make check-lld-macho

Differential revision: https://reviews.llvm.org/D102664
The file was modifiedlld/MachO/InputSection.cpp
The file was modifiedlld/MachO/InputSection.h
Commit 57c660f3742f2044f0dd555469f87b7b349dba0d by serguei.katkov
[Statepoint Lowering] Cleanup: remove unused option statepoint-always-spill-base.
The file was modifiedllvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
Commit 3bc2b97b34ff1d5f817793f83961192e62d5fc7b by Pushpinder.Singh
[AMDGPU][libomptarget] Remove unused global variables

This initial patch removes some unused variables from global namespace.
There will more incoming patches for moving global variables to classes
or static members.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D102598
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/internal.h
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/machine.cpp
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/system.cpp
Commit 797ad701522988e212495285dade8efac41a24d4 by tentzen
[Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

This patch is the Part-1 (FE Clang) implementation of HW Exception handling.

This new feature adds the support of Hardware Exception for Microsoft Windows
SEH (Structured Exception Handling).
This is the first step of this project; only X86_64 target is enabled in this patch.

Compiler options:
For clang-cl.exe, the option is -EHa, the same as MSVC.
For clang.exe, the extra option is -fasync-exceptions,
plus -triple x86_64-windows -fexceptions and -fcxx-exceptions as usual.

NOTE:: Without the -EHa or -fasync-exceptions, this patch is a NO-DIFF change.

The rules for C code:
For C-code, one way (MSVC approach) to achieve SEH -EHa semantic is to follow
three rules:
* First, no exception can move in or out of _try region., i.e., no "potential
  faulty instruction can be moved across _try boundary.
* Second, the order of exceptions for instructions 'directly' under a _try
  must be preserved (not applied to those in callees).
* Finally, global states (local/global/heap variables) that can be read
  outside of _try region must be updated in memory (not just in register)
  before the subsequent exception occurs.

The impact to C++ code:
Although SEH is a feature for C code, -EHa does have a profound effect on C++
side. When a C++ function (in the same compilation unit with option -EHa ) is
called by a SEH C function, a hardware exception occurs in C++ code can also
be handled properly by an upstream SEH _try-handler or a C++ catch(...).
As such, when that happens in the middle of an object's life scope, the dtor
must be invoked the same way as C++ Synchronous Exception during unwinding
process.

Design:
A natural way to achieve the rules above in LLVM today is to allow an EH edge
added on memory/computation instruction (previous iload/istore idea) so that
exception path is modeled in Flow graph preciously. However, tracking every
single memory instruction and potential faulty instruction can create many
Invokes, complicate flow graph and possibly result in negative performance
impact for downstream optimization and code generation. Making all
optimizations be aware of the new semantic is also substantial.

This design does not intend to model exception path at instruction level.
Instead, the proposed design tracks and reports EH state at BLOCK-level to
reduce the complexity of flow graph and minimize the performance-impact on CPP
code under -EHa option.

One key element of this design is the ability to compute State number at
block-level. Our algorithm is based on the following rationales:

A _try scope is always a SEME (Single Entry Multiple Exits) region as jumping
into a _try is not allowed. The single entry must start with a seh_try_begin()
invoke with a correct State number that is the initial state of the SEME.
Through control-flow, state number is propagated into all blocks. Side exits
marked by seh_try_end() will unwind to parent state based on existing
SEHUnwindMap[].
Note side exits can ONLY jump into parent scopes (lower state number).
Thus, when a block succeeds various states from its predecessors, the lowest
State triumphs others.  If some exits flow to unreachable, propagation on those
paths terminate, not affecting remaining blocks.
For CPP code, object lifetime region is usually a SEME as SEH _try.
However there is one rare exception: jumping into a lifetime that has Dtor but
has no Ctor is warned, but allowed:

Warning: jump bypasses variable with a non-trivial destructor

In that case, the region is actually a MEME (multiple entry multiple exits).
Our solution is to inject a eha_scope_begin() invoke in the side entry block to
ensure a correct State.

Implementation:
Part-1: Clang implementation described below.

Two intrinsic are created to track CPP object scopes; eha_scope_begin() and eha_scope_end().
_scope_begin() is immediately added after ctor() is called and EHStack is pushed.
So it must be an invoke, not a call. With that it's also guaranteed an
EH-cleanup-pad is created regardless whether there exists a call in this scope.
_scope_end is added before dtor(). These two intrinsics make the computation of
Block-State possible in downstream code gen pass, even in the presence of
ctor/dtor inlining.

Two intrinsic, seh_try_begin() and seh_try_end(), are added for C-code to mark
_try boundary and to prevent from exceptions being moved across _try boundary.
All memory instructions inside a _try are considered as 'volatile' to assure
2nd and 3rd rules for C-code above. This is a little sub-optimized. But it's
acceptable as the amount of code directly under _try is very small.

Part-2 (will be in Part-2 patch): LLVM implementation described below.

For both C++ & C-code, the state of each block is computed at the same place in
BE (WinEHPreparing pass) where all other EH tables/maps are calculated.
In addition to _scope_begin & _scope_end, the computation of block state also
rely on the existing State tracking code (UnwindMap and InvokeStateMap).

For both C++ & C-code, the state of each block with potential trap instruction
is marked and reported in DAG Instruction Selection pass, the same place where
the state for -EHsc (synchronous exceptions) is done.
If the first instruction in a reported block scope can trap, a Nop is injected
before this instruction. This nop is needed to accommodate LLVM Windows EH
implementation, in which the address in IPToState table is offset by +1.
(note the purpose of that is to ensure the return address of a call is in the
same scope as the call address.

The handler for catch(...) for -EHa must handle HW exception. So it is
'adjective' flag is reset (it cannot be IsStdDotDot (0x40) that only catches
C++ exceptions).
Suppress push/popTerminate() scope (from noexcept/noTHrow) so that HW
exceptions can be passed through.

Original llvm-dev [RFC] discussions can be found in these two threads below:
https://lists.llvm.org/pipermail/llvm-dev/2020-March/140541.html
https://lists.llvm.org/pipermail/llvm-dev/2020-April/141338.html

Differential Revision: https://reviews.llvm.org/D80344/new/
The file was modifiedclang/lib/CodeGen/CGCleanup.cpp
The file was modifiedclang/lib/CodeGen/CodeGenFunction.h
The file was addedclang/test/CodeGen/windows-seh-EHa-CppCatchDotDotDot.cpp
The file was modifiedclang/lib/CodeGen/EHScopeStack.h
The file was modifiedclang/lib/CodeGen/MicrosoftCXXABI.cpp
The file was addedclang/test/CodeGen/windows-seh-EHa-CppDtors01.cpp
The file was addedclang/test/CodeGen/windows-seh-EHa-CppCondiTemps.cpp
The file was modifiedclang/lib/AST/JSONNodeDumper.cpp
The file was modifiedclang/lib/CodeGen/CodeGenFunction.cpp
The file was modifiedllvm/docs/LangRef.rst
The file was addedclang/test/CodeGen/windows-seh-EHa-TryInFinally.cpp
The file was modifiedllvm/lib/IR/Verifier.cpp
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedclang/include/clang/Basic/LangOptions.def
The file was modifiedclang/lib/CodeGen/CGStmt.cpp
The file was modifiedclang/lib/CodeGen/CodeGenModule.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
The file was modifiedclang/lib/Sema/JumpDiagnostics.cpp
The file was modifiedclang/lib/Serialization/ASTWriterStmt.cpp
The file was modifiedclang/lib/Serialization/ASTReaderStmt.cpp
The file was modifiedclang/lib/CodeGen/CGException.cpp
The file was modifiedllvm/include/llvm/IR/Intrinsics.td
The file was modifiedclang/lib/AST/TextNodeDumper.cpp
The file was modifiedclang/include/clang/AST/Stmt.h
The file was modifiedclang/include/clang/Driver/Options.td
Commit d7503c3bce491e2672386906ec879c7df5ede7a5 by Pushpinder.Singh
[AMDGPU][Libomptarget] Rename & move g_executables to private

This patch moves g_executables to private member of Runtime class
and is renamed to HSAExecutables following LLVM naming convention.

This movement required making Runtime::Initialize and Runtime::Finalize
non-static. Verified the correctness of this change by running
libomptarget tests on gfx906.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D102600
The file was modifiedopenmp/libomptarget/plugins/amdgpu/src/rtl.cpp
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/atmi.cpp
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/system.cpp
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/rt.h

Summary

  1. [sanitizer] Remove disabled line (details)
  2. [sanitizer] Fix COMPILER_RT_DEBUG assignment (details)
  3. Added missing comma in clang-ppc64le-rhel builder configuration. (details)
  4. [sanitizer][NFC] Reuse cmake setup (details)
  5. [sanitizer] Fix asan builder name (details)
  6. [sanitizer] Remove unused GN reference (details)
  7. [sanitizer] Add dedicated QEMU builder (details)
Commit ac6a7e6e071c77bc081de358266075a938a11e39 by Vitaly Buka
[sanitizer] Remove disabled line
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_qemu.sh
Commit 76d050f0ff7e2517953936571ced397817a4a2e0 by Vitaly Buka
[sanitizer] Fix COMPILER_RT_DEBUG assignment
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_qemu.sh
Commit 8bbdd35de2d2a8513bbe4f62250ca1cf8f0a38fd by gkistanova
Added missing comma in clang-ppc64le-rhel builder configuration.
The file was modifiedbuildbot/osuosl/master/config/builders.py
Commit 1d14b1b88e1b3b85b286e855a61813991d8d8d3b by Vitaly Buka
[sanitizer][NFC] Reuse cmake setup
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_qemu.sh
Commit 91a7eff07ec1801011fc2e171ba2ec55108abc82 by Vitaly Buka
[sanitizer] Fix asan builder name
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_selector.py
The file was modifiedbuildbot/osuosl/master/config/builders.py
Commit 594bf9c4e3d7ddb82ad88b3f809f586c35417d05 by Vitaly Buka
[sanitizer] Remove unused GN reference
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_selector.py
Commit 8d4ef0058071a232fd2a03f78194a167c3815f87 by Vitaly Buka
[sanitizer] Add dedicated QEMU builder
The file was modifiedbuildbot/osuosl/master/config/builders.py
The file was modifiedzorg/buildbot/builders/sanitizers/buildbot_selector.py