SuccessChanges

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. Re-apply "[ELF] Allow getErrPlace() to work before Out::bufferStart is (details)
  2. MipsDelaySlotFiller: Update registers def-uses for BUNDLE instructions (details)
  3. [mlir] NFC: Move the state for managing SSA value names out of (details)
  4. [libc++] Explicitly enumerate std::string external instantiations. (details)
  5. [clang-tidy] Refresh the add_new_check.py now that we use a table + (details)
  6. [clangd] Handle DeducedTemplateSpecializationType in TargetFinder (details)
  7. phab doc: remove the svn section (details)
  8. phab doc: also document 'arc land' (details)
  9. phab doc: Replace or remove references to svn (details)
  10. AMDGPU/GlobalISel: Widen 16-bit shift amount sources (details)
  11. AMDGPU/GlobalISel: Fix argument lowering for vectors of pointers (details)
  12. GlobalISel: Don't assert on MoreElements creating vectors (details)
  13. TableGen/GlobalISel: Address fixme (details)
  14. GlobalISel: Move getLLTForMVT/getMVTForLLT (details)
  15. Add gdb pretty printer for MutableArrayRef, remove ConstArrayRef. (details)
  16. Add builtins for aligning and checking alignment of pointers and (details)
  17. [mlir] mlir-cpu-runner test's cblas_interface should export functions on (details)
  18. [mlir] add a missing dependency for Linalg conversion (details)
Commit 1444e6e2e6f6b76cc9d5aab8b1877926aa6d5597 by Alexander.Richardson
Re-apply "[ELF] Allow getErrPlace() to work before Out::bufferStart is
set"
This time with a fix for the UBSAN failure.
Differential Revision: https://reviews.llvm.org/D70659
The file was modifiedlld/test/ELF/mips-jalr-non-functions.s
The file was modifiedlld/ELF/Target.cpp
Commit 646ca7d7e72e8408b3fa3472018eb9d1c2643ff5 by Alexander.Richardson
MipsDelaySlotFiller: Update registers def-uses for BUNDLE instructions
Summary: In commit b91f239485fb7bb8d29be3e0b60660a2de7570a9 I updated
the MipsDelaySlotFiller to skip BUNDLE instructions. However, in
addition to not considering BUNDLE instructions for the delay slot, we
also need to ensure that the register def-use information is updated.
Not updating this information caused run-time crashes (when using the
out-of-tree CHERI backend) since later definitions could be overwritten
with earlier register values.
Reviewers: atanasyan Reviewed By: atanasyan Differential Revision:
https://reviews.llvm.org/D72254
The file was modifiedllvm/lib/Target/Mips/MipsDelaySlotFiller.cpp
The file was addedllvm/test/CodeGen/Mips/delay-slot-filler-bundled-insts-def-use.mir
Commit fc3367dd5ed4698036c421b23cf4f52cf8aedcae by riverriddle
[mlir] NFC: Move the state for managing SSA value names out of
OperationPrinter and into a new class SSANameState.
Summary: This reduces the complexity of OperationPrinter and simplifies
the code by quite a bit. The SSANameState is now held by ModuleState.
This is in preparation for a future revision that molds ModuleState into
something that can be used by users for caching the printer state, as
well as for implementing printAsOperand style methods.
Depends On D72292
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D72293
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
Commit 61bd19206f61ace4b007838a2ff8884a13ec0374 by eric
[libc++] Explicitly enumerate std::string external instantiations.
The external instantiation of std::string is a problem for libc++.
   Additions and removals of inline functions in string can cause ABI
   breakages, including introducing new symbols.
    This patch aims to:
     (1) Make clear which functions are explicitly instatiated.
     (2) Prevent new functions from being accidentally instantiated.
     (3) Allow a migration path for adding or removing functions from
the
     explicit instantiation over time.
    Although this new formulation is uglier, it is preferable from a
   maintainability and readability standpoint because it explicitly
   enumerates the functions we've chosen to expose in our ABI. Changing
   this list is non-trivial and requires thought and planning.
    (3) is achieved by making it possible to control the extern template
declaration
   separately from it's definition. Meaning we could add a new
definition to
   the dylib, wait for it to roll out, then add the extern template
   declaration to the header. Similarly, we could remove existing extern
   template declarations while still keeping the definition to prevent
ABI
   breakages.
The file was modifiedlibcxx/include/__config
The file was modifiedlibcxx/src/string.cpp
The file was modifiedlibcxx/include/string
The file was modifiedlibcxx/include/__string
Commit c348a2674b5753afde6842d5a6ee75db111167e3 by sledru
[clang-tidy] Refresh the add_new_check.py now that we use a table +
autofix
Reviewers: alexfh
Reviewed By: alexfh
Subscribers: njames93, xazax.hun, mgorny, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D72421
The file was modifiedclang-tools-extra/clang-tidy/add_new_check.py
Commit 6a69d3c6b3da3d4e7709d11fd52b8e5540265280 by zeratul976
[clangd] Handle DeducedTemplateSpecializationType in TargetFinder
Summary: This is a workaround for
https://bugs.llvm.org/show_bug.cgi?id=42914. Once that is fixed, the
handling in VisitDeducedTyped() should be sufficient.
Fixes https://github.com/clangd/clangd/issues/242
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet,
usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72119
The file was modifiedclang-tools-extra/clangd/unittests/FindTargetTests.cpp
The file was modifiedclang-tools-extra/clangd/FindTarget.cpp
Commit 004ae200a5a818ea87d71e4e686939dec4a8d757 by sledru
phab doc: remove the svn section
The file was modifiedllvm/docs/Phabricator.rst
Commit dbfc516d1f1685b4d11910bceab6625ada4399a2 by sledru
phab doc: also document 'arc land'
The file was modifiedllvm/docs/Phabricator.rst
Commit 0c195ef7c62db1234e3854f8798e1ef413808b18 by sledru
phab doc: Replace or remove references to svn
The file was modifiedllvm/docs/Phabricator.rst
Commit 35ad66fae811c36823b2b91368f142c9d35b8414 by arsenm2
AMDGPU/GlobalISel: Widen 16-bit shift amount sources
This should be legal, but will require future selection work. 16-bit
shift amounts were already removed from being legal, but this didn't
adjust the transformation rules.
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-lshr.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-shl.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-ashr.mir
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
Commit 767aa507a464e46b9a5aaed8cfec0a621f8fc599 by arsenm2
AMDGPU/GlobalISel: Fix argument lowering for vectors of pointers
When these arguments are broken down by the EVT based callbacks, the
pointer information is lost. Hack around this by coercing the register
types to be the expected pointer element type when building the remerge
operations.
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-function-args.ll
Commit fba1fbb9c7367990a0561a36dbf600fc51847246 by arsenm2
GlobalISel: Don't assert on MoreElements creating vectors
If the original type was a scalar, it should be valid to add elements to
turn it into a vector.
Tests included with following legalization change.
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
Commit f937b43fdb30b67facf616ad394976b08001ee89 by arsenm2
TableGen/GlobalISel: Address fixme
Don't call computeAvailableFunctionFeatures for every instruction.
The file was modifiedllvm/test/TableGen/GlobalISelEmitter.td
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h
The file was modifiedllvm/utils/TableGen/GlobalISelEmitter.cpp
Commit 595ac8c46ea54c6d5dc96e2f35a5759988a657be by arsenm2
GlobalISel: Move getLLTForMVT/getMVTForLLT
As an intermediate step, some TLI functions can be converted to using
LLT instead of MVT. Move this somewhere out of GlobalISel so DAG
functions can use these.
The file was modifiedllvm/lib/CodeGen/LowLevelType.cpp
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/Utils.h
The file was modifiedllvm/include/llvm/CodeGen/LowLevelType.h
The file was modifiedllvm/lib/CodeGen/GlobalISel/Utils.cpp
Commit 0f5f28d000f73b4d0282c579477a4e31402a863e by csigg
Add gdb pretty printer for MutableArrayRef, remove ConstArrayRef.
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: merge_guards_bot, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72136
The file was modifiedllvm/utils/gdb-scripts/prettyprinters.py
Commit 8c387cbea76b169f1f8ecc7693797e96567ed896 by Alexander.Richardson
Add builtins for aligning and checking alignment of pointers and
integers
This change introduces three new builtins (which work on both pointers
and integers) that can be used instead of common bitwise arithmetic:
__builtin_align_up(x, alignment), __builtin_align_down(x, alignment) and
__builtin_is_aligned(x, alignment).
I originally added these builtins to the CHERI fork of LLVM a few years
ago to handle the slightly different C semantics that we use for CHERI
[1]. Until recently these builtins (or sequences of other builtins) were
required to generate correct code. I have since made changes to the
default C semantics so that they are no longer strictly necessary (but
using them does generate slightly more efficient code). However, based
on our experience using them in various projects over the past few
years, I believe that adding these builtins to clang would be useful.
These builtins have the following benefit over bit-manipulation and
casts via uintptr_t:
- The named builtins clearly convey the semantics of the operation.
While
checking alignment using __builtin_is_aligned(x, 16) versus
((x & 15) == 0) is probably not a huge win in readably, I personally
find
__builtin_align_up(x, N) a lot easier to read than (x+(N-1))&~(N-1).
- They preserve the type of the argument (including const qualifiers).
When
using casts via uintptr_t, it is easy to cast to the wrong type or
strip
qualifiers such as const.
- If the alignment argument is a constant value, clang can check that it
is
a power-of-two and within the range of the type. Since the semantics of
these builtins is well defined compared to arbitrary bit-manipulation,
it is possible to add a UBSAN checker that the run-time value is a
valid
power-of-two. I intend to add this as a follow-up to this change.
- The builtins avoids int-to-pointer casts both in C and LLVM IR.
In the future (i.e. once most optimizations handle it), we could use
the new
llvm.ptrmask intrinsic to avoid the ptrtoint instruction that would
normally
be generated.
- They can be used to round up/down to the next aligned value for both
integers and pointers without requiring two separate macros.
- In many projects the alignment operations are already wrapped in
macros (e.g.
roundup2 and rounddown2 in FreeBSD), so by replacing the macro
implementation
with a builtin call, we get improved diagnostics for many call-sites
while
only having to change a few lines.
- Finally, the builtins also emit assume_aligned metadata when used on
pointers.
This can improve code generation compared to the uintptr_t casts.
[1] In our CHERI compiler we have compilation mode where all pointers
are implemented as capabilities (essentially unforgeable 128-bit fat
pointers). In our original model, casts from uintptr_t (which is a
128-bit capability) to an integer value returned the "offset" of the
capability (i.e. the difference between the virtual address and the base
of the allocation). This causes problems for cases such as checking the
alignment: for example, the expression `if ((uintptr_t)ptr & 63) == 0`
is generally used to check if the pointer is aligned to a multiple of 64
bytes. The problem with offsets is that any pointer to the beginning of
an allocation will have an offset of zero, so this check always succeeds
in that case (even if the address is not correctly aligned). The same
issues also exist when aligning up or down. Using the alignment builtins
ensures that the address is used instead of the offset. While I have
since changed the default C semantics to return the address instead of
the offset when casting, this offset compilation mode can still be used
by passing a command-line flag.
Reviewers: rsmith, aaron.ballman, theraven, fhahn, lebedev.ri, nlopes,
aqjune Reviewed By: aaron.ballman, lebedev.ri Differential Revision:
https://reviews.llvm.org/D71499
The file was modifiedclang/include/clang/Basic/DiagnosticASTKinds.td
The file was modifiedclang/docs/LanguageExtensions.rst
The file was addedclang/test/CodeGen/builtin-align-assumption.c
The file was addedclang/test/CodeGen/builtin-align.c
The file was addedclang/test/Sema/builtin-align.c
The file was addedclang/test/CodeGen/builtin-align-array.c
The file was modifiedclang/include/clang/Basic/Builtins.def
The file was modifiedclang/lib/AST/ExprConstant.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/lib/CodeGen/CGBuiltin.cpp
The file was modifiedclang/lib/Sema/SemaChecking.cpp
The file was addedclang/test/SemaCXX/builtin-align-cxx.cpp
The file was modifiedclang/lib/CodeGen/CodeGenFunction.h
Commit ea67737b166fc6cb5fd98874fbd2b4639b2d7ecd by zinenko
[mlir] mlir-cpu-runner test's cblas_interface should export functions on
Windows
This change fixes the build on Windows, so that cblas_interface.dll
exports functions correctly and an implib is created and installed
correctly.
Currently, LLVM cannot be consumed on Windows after it has been
installed in a location because cblas_interface.lib is not
created/installed, thus failing the import check in `LLVMExports.cmake`.
Differential Revision: https://reviews.llvm.org/D72384
The file was modifiedmlir/test/mlir-cpu-runner/cblas_interface.cpp
The file was modifiedmlir/test/mlir-cpu-runner/include/mlir_runner_utils.h
The file was modifiedmlir/test/mlir-cpu-runner/CMakeLists.txt
The file was addedmlir/test/mlir-cpu-runner/include/cblas_interface.h
The file was modifiedmlir/test/mlir-cpu-runner/include/cblas.h
Commit 016bf03ef6fcd9dce43b0c17971f76323f07a684 by zinenko
[mlir] add a missing dependency for Linalg conversion
We were seeing some occasional build failures that would come and go. It
appeared to be this missing dependence.
Differential Revision: https://reviews.llvm.org/D72419
The file was modifiedmlir/lib/Conversion/LinalgToLLVM/CMakeLists.txt