Changes

Summary

  1. [AMDGPU] Add patterns for i8/i16 local atomic load/store (details)
  2. Add new MachineFunction property FailsVerification (details)
  3. Remove the verifyAfter mechanism that was replaced by D111397 (details)
  4. Fix signed/unsigned comparison after b5426ced71280 (details)
  5. [AMDGPU] Add link to bug (details)
  6. [clang][modules] Delay creating `IdentifierInfo` for names of explicit modules (details)
  7. [lldb] Fix SymbolFilePDBTests for a3939e1 (details)
  8. [lldb][NFC] clang format change (details)
  9. [NFC] Remove Block-ABI-Apple.txt (details)
  10. Revert "[NFC] [LoopPeel] Change the way DT is updated for loop exits" (details)
  11. [lldb] [lldb-server] Refactor ConnectToRemote() (details)
  12. [DebugInfo][InstrRef] Avoid a crash during DBG_PHI maintenence (details)
  13. [AMDGPU] Remove unused VirtRegMap analysis. NFC. (details)
  14. [InstCombine][DebugInfo] Remove superflous assertion, add test (details)
  15. [AArch64][SVE][CodeGen] Add tests for RSHRN{T,B} instructions (details)
  16. [DebugInfo] Correctly handle arrays with 0-width elements in GEP salvaging (details)
  17. [Sema] haveSameParameterTypes - replace repeated isNull() test with assertions (details)
  18. [OpenMP][Tests][NFC] Flagging OMPT tests as XFAIL for Intel compilers (details)
  19. [OpenMP][Tests][NFC] Work around ICC bug (details)
  20. [OpenMP][OMPT] thread_num determination for programs with explicit tasks (details)
  21. [lldb] Fix PDB/compilands.test for a3939e1 (details)
Commit d869921004526e804f344936d671a994852ab4d2 by Piotr Sobczak
[AMDGPU] Add patterns for i8/i16 local atomic load/store

Add patterns for i8/i16 local atomic load/store.

Added tests for new patterns.

Copied atomic_[store/load]_local.ll to GlobalISel directory.

Differential Revision: https://reviews.llvm.org/D111869
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUInstructions.td
The file was modifiedllvm/test/CodeGen/AMDGPU/atomic_load_local.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/atomic_store_local.ll
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/atomic_load_local.ll
The file was modifiedllvm/lib/Target/AMDGPU/DSInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.td
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/atomic_store_local.ll
Commit 36deb9a670d06fc254df2f357ae595fb8f817d07 by jay.foad
Add new MachineFunction property FailsVerification

TargetPassConfig::addPass takes a "bool verifyAfter" argument which lets
you skip machine verification after a particular pass. Unfortunately
this is used in generic code in TargetPassConfig itself to skip
verification after a generic pass, only because some previous target-
specific pass damaged the MIR on that specific target. This is bad
because problems in one target cause lack of verification for all
targets.

This patch replaces that mechanism with a new MachineFunction property
called "FailsVerification" which can be set by (usually target-specific)
passes that are known to introduce problems. Later passes can reset it
again if they are known to clean up the previous problems.

Differential Revision: https://reviews.llvm.org/D111397
The file was modifiedllvm/lib/CodeGen/MachineVerifier.cpp
The file was modifiedllvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
The file was modifiedllvm/include/llvm/CodeGen/MIRYamlMapping.h
The file was modifiedllvm/lib/CodeGen/MIRPrinter.cpp
The file was modifiedllvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
The file was modifiedllvm/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp
The file was modifiedllvm/lib/CodeGen/MIRParser/MIRParser.cpp
The file was modifiedllvm/include/llvm/CodeGen/MachineFunction.h
The file was modifiedllvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
The file was modifiedllvm/lib/CodeGen/MachineFunction.cpp
Commit 012248b0bc8e638d96db22dd091adca2ef9549db by jay.foad
Remove the verifyAfter mechanism that was replaced by D111397

Differential Revision: https://reviews.llvm.org/D111872
The file was modifiedllvm/lib/Target/SystemZ/SystemZTargetMachine.cpp
The file was modifiedllvm/lib/Target/XCore/XCoreTargetMachine.cpp
The file was modifiedllvm/lib/CodeGen/TargetPassConfig.cpp
The file was modifiedllvm/lib/Target/MSP430/MSP430TargetMachine.cpp
The file was modifiedllvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
The file was modifiedllvm/lib/Target/Hexagon/HexagonTargetMachine.cpp
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
The file was modifiedllvm/include/llvm/CodeGen/TargetPassConfig.h
The file was modifiedllvm/lib/Target/AMDGPU/R600TargetMachine.cpp
Commit ea970661dc74505da6c45f6c83579aabb115ecc5 by jeremy.morse
Fix signed/unsigned comparison after b5426ced71280

gcc11 warns that this counter causes a signed/unsigned comaprison when it's
later compared with a SmallVector::difference_type. gcc appears to be
correct, clang does not warn one way or the other.
The file was modifiedllvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
Commit a129932b0d45949a884cee90726bf90217c2e737 by jay.foad
[AMDGPU] Add link to bug
The file was modifiedllvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
Commit a2d805c020a1658b04ed7e606ee67e234a9d5b56 by Jan Svoboda
[clang][modules] Delay creating `IdentifierInfo` for names of explicit modules

When using explicit Clang modules, some declarations might unexpectedly become invisible.

This is caused by the mechanism that loads PCM files passed via `-fmodule-file=<path>` and creates an `IdentifierInfo` for the module name. The `IdentifierInfo` creation takes place when the `ASTReader` is in a weird state, with modules that are loaded but not yet set up properly. This patch delays the creation of `IdentifierInfo` until the `ASTReader` is done with reading the PCM.

Note that the `-fmodule-file=<name>=<path>` form of the argument doesn't suffer from this issue, since it doesn't create `IdentifierInfo` for the module name.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D111543
The file was addedclang/test/Modules/Inputs/module-name-used-by-objc-bridge/module.modulemap
The file was addedclang/test/Modules/module-name-used-by-objc-bridge.m
The file was modifiedclang/lib/Frontend/CompilerInstance.cpp
The file was addedclang/test/Modules/Inputs/module-name-used-by-objc-bridge/InterfaceBridge.h
The file was addedclang/test/Modules/Inputs/module-name-used-by-objc-bridge/Interface.h
Commit d914aa4ead2aabda2c9e2cf343d30ba8171e4ce2 by pavel
[lldb] Fix SymbolFilePDBTests for a3939e1
The file was modifiedlldb/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
Commit ee691fbc3de36ca0c720e1699565be34f192e058 by werat
[lldb][NFC] clang format change

clang format on some demangling files

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D111934
The file was modifiedllvm/include/llvm/Demangle/Demangle.h
The file was modifiedlldb/source/Core/Mangled.cpp
Commit c773f6501dba6975660ce16ab73e6d86a10e6b71 by shivam98.tkg
[NFC] Remove Block-ABI-Apple.txt

This file was rewritten in rst format in clang/docs/Block-ABI-Apple.rst
The file was removedclang/docs/Block-ABI-Apple.txt
Commit baad10c09e44bb243d95821f6ea44641cfa94419 by mkazantsev
Revert "[NFC] [LoopPeel] Change the way DT is updated for loop exits"

This reverts commit fa16329ae0721023376f24c7577b9020d438df1a.

See comments in discussion. Merged by mistake, not entirely getting what
the problem was.
The file was modifiedllvm/lib/Transforms/Utils/LoopPeel.cpp
Commit d8bc7e40ce1cdd8c1a3fac7937ce1ea85c262728 by mgorny
[lldb] [lldb-server] Refactor ConnectToRemote()

Refactor ConnectToRemote() to improve readability and make future
changes easier:

1. Replace static buffers with std::string.
2. When handling errors, prefer reporting the actual error over dumb
   'connection status is not success'.
3. Move host/port parsing directly into reverse_connection condition
   that is its only user, and simplify it to make its purpose (verifying
   that a valid port is provided) clear.
4. Use llvm::errs() and llvm::outs() instead of fprintf().

Differential Revision: https://reviews.llvm.org/D11196
The file was modifiedlldb/tools/lldb-server/lldb-gdbserver.cpp
Commit c4ede6d60892a5101d159b4876ad76fc8eefc837 by jeremy.morse
[DebugInfo][InstrRef] Avoid a crash during DBG_PHI maintenence

With D110105, the isDebug flag for register uses is now a proxy for whether
the instruction is a debug instruction; that causes DBG_PHIs to have their
operands updated by calls to updateDbgUsersToReg, which is the correct
behaviour. However: that function only expects to receive DBG_VALUE
instructions and asserts such.

This patch splits the updating-action into a lambda, and applies it to the
appropriate operands for each kind of debug instruction. Tested with an
ARM test that stimulates this function: I've added some DBG_PHI
instructions that should be updated in the same way as DBG_VALUEs.

Differential Revision: https://reviews.llvm.org/D108641
The file was modifiedllvm/include/llvm/CodeGen/MachineRegisterInfo.h
The file was modifiedllvm/test/DebugInfo/ARM/machine-cp-updates-dbg-reg.mir
Commit d55db4b033f037d60489a145ab3fdd0a0ce3a389 by jay.foad
[AMDGPU] Remove unused VirtRegMap analysis. NFC.
The file was modifiedllvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
Commit c4603a8a4384d36d23fd284689b453b9927541be by peter.waller
[InstCombine][DebugInfo] Remove superflous assertion, add test

When this code was added, an unnecessary assertion slipped in which we
now hit in real code.

Add a test to defend against it firing again.
The file was modifiedllvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll
The file was modifiedllvm/lib/Transforms/Utils/Local.cpp
Commit c0782ba898ffd4ae8b171d100d8d83afdea038d9 by peter.waller
[AArch64][SVE][CodeGen] Add tests for RSHRN{T,B} instructions

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D111735
The file was modifiedllvm/test/CodeGen/AArch64/sve2-intrinsics-binary-narrowing-shr.ll
Commit b9ca73e1a8fd0c018b0b3eb313163da2b4ca4e09 by stephen.tozer
[DebugInfo] Correctly handle arrays with 0-width elements in GEP salvaging

Fixes an issue where GEP salvaging did not properly account for GEP
instructions which stepped over array elements of width 0 (effectively a
no-op). This unnecessarily produced long expressions by appending
`... + (x * 0)` and potentially extended the number of SSA values used
in the dbg.value. This also erroneously triggered an assert in the
salvage function that the element width would be strictly positive.
These issues are resolved by simply ignoring these useless operands.

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D111809
The file was modifiedllvm/test/DebugInfo/salvage-gep.ll
The file was modifiedllvm/lib/IR/Operator.cpp
Commit 3b3509b3cba272c98d2235a8664ae9625ac729f8 by llvm-dev
[Sema] haveSameParameterTypes - replace repeated isNull() test with assertions

As reported on https://pvs-studio.com/en/blog/posts/cpp/0771/ (Snippet 2) - (and mentioned on rGdc4259d5a38409) we are repeating the T1.isNull() check instead of checking T2.isNull() as well, and at this point neither should be null - so we're better off with an assertion.

Differential Revision: https://reviews.llvm.org/D107347
The file was modifiedclang/lib/Sema/SemaOverload.cpp
Commit 5918688248fa103c46da3a6ff86e7fab0e63fb45 by protze
[OpenMP][Tests][NFC] Flagging OMPT tests as XFAIL for Intel compilers

With Intel 19 compiler the teams tests fail to link while trying to link
liboffload.
The file was modifiedopenmp/runtime/test/ompt/tasks/dependences_mutexinoutset.c
The file was modifiedopenmp/runtime/test/ompt/teams/team.c
The file was modifiedopenmp/runtime/test/ompt/teams/serialized.c
The file was modifiedopenmp/runtime/test/ompt/tasks/taskwait-depend.c
The file was modifiedopenmp/runtime/test/ompt/teams/parallel_team.c
The file was modifiedopenmp/runtime/test/ompt/teams/serial_teams.c
Commit c93fb143b98ea2035c6fca95241bc5ba40faf97e by protze
[OpenMP][Tests][NFC] Work around ICC bug
Older intel compilers miss the privatization of nested loop variables for
doacross loops. Declaring the variable in the loop makes the test more
robust.
The file was modifiedopenmp/runtime/test/ompt/synchronization/ordered_dependences.c
Commit 59a994e8daeef94976841a11bc92ca3a2b6a10b3 by protze
[OpenMP][OMPT] thread_num determination for programs with explicit tasks

__ompt_get_task_info_internal is now able to determine the right value of the
“thread_num” argument during the execution of an explicit task.

During the execution of a while loop that iterates over the ancestor tasks
hierarchy, the “prev_team” variable was always set to “team” variable at the
beginning of each loop iteration.

Assume that the program contains a parallel region which encloses an explicit
task executed by the worker thread of the region. Also assume that the tool
inquires the “thread_num” of a worker thread for the implicit task that
corresponds to the region (task at “ancestor_level == 1”) and expects to
receive the value of “thread_num > 0”.
After the loop finishes, both “team” and “prev_team” variables are equal and
point to the team information of the parallel region.
The “thread_num” is set to “prev_team->t.t_master_tid”, that is equal to
“team->t.t_master_tid”. In this case, “team->t.t_master_tid” is 0, since
the master thread of the region is the initial master thread of the program.
This leads to a contradiction.

To prevent this, “prev_team” variable is set to “team” variable only at the
time when the loop that has already encountered the implicit task (“taskdata”
variable contains the information about an implicit task) continues iterating
over the implicit task’s ancestors, if any.

After the mentioned loop finishes, the “prev_team” variable might be equal to
NULL. This means that the task at requested “ancestor_level” belongs to the
innermost parallel region, so the “thread_num” will be determined by calling
the “__kmp_get_tid”.

To prove that this patch works, the test case “explicit_task_thread_num.c” is
provided.
It contains the example of the program explained earlier in the summary.

Differential Revision: https://reviews.llvm.org/D110473
The file was modifiedopenmp/runtime/src/ompt-specific.cpp
The file was addedopenmp/runtime/test/ompt/tasks/explicit_task_thread_num.c
Commit b37efed957ed0a0193d80020aefd55cb587dfc1f by pavel
[lldb] Fix PDB/compilands.test for a3939e1
The file was modifiedlldb/test/Shell/SymbolFile/PDB/compilands.test