Changes

Summary

  1. [COFF] Check table ptr more thoroughly and ignore empty sections (details)
  2. [COFF] Fix -Wredundant-move (details)
  3. [RISCV] Reduce scalar load/store isel patterns to a single ComplexPattern. NFCI (details)
  4. [BOLT] Cache-Aware Tail Duplication (details)
  5. [Attributes] Remove AttrSyntax and migrate uses to AttributeCommonInfo::Syntax (NFC) (details)
  6. llvm: cmake: set CMP0114 to OLD to avoid warning (details)
  7. [MSAN] add dn_expand intercept. (details)
  8. [LLVM] [NFC] remove unnecessary, confusing scope (details)
  9. Re-land "[mlir] Add integer range inference analysis"" (details)
  10. [config] Remove LLVM_DEFAULT_TARGET_TRILE from config.h (details)
  11. [RISCV] Use SelectionDAG::isBaseWithConstantOffset in scalar load/store address matching. (details)
  12. [NFC] Fix issue on CMake Xcode build configuration. (details)
  13. [MSAN] Exclude dn_expand test from Android. (details)
  14. [libc++] Forward more often to memmove in copy (details)
  15. CommandObjectRegexCommand shouldn't put two commands on the history stack. (details)
  16. [pseudo] Eliminate dependencies from clang-pseudo-gen. NFC (details)
  17. [bazel] Port 95aff23e2921 (details)
  18. [lld][WebAssembly] Remove unnecessary accessor methods. NFC (details)
  19. [pseudo] rename pseudo-gen -> clang-pseudo-gen. NFC (details)
  20. [pseudo] Add CLANG_PSEUDO_GEN cmake cache variable to avoid nested CMake invocation (details)
Commit bb94611d6545c2c5271f5bb01de1aa4228a37250 by martin
[COFF] Check table ptr more thoroughly and ignore empty sections

When loading split debug files for PE/COFF executables (produced with
`objcopy --only-keep-debug`), the tables or directories in such files
may point to data inside sections that may have been stripped.
COFFObjectFile shall detect and gracefully handle this, to allow the
object file be loaded without considering these tables or directories.
This is required for LLDB to load these files for use as debug symbols.

COFFObjectFile shall also check these pointers more carefully to account
for cases in which the section contains less raw data than the size
given by VirtualSize, to prevent going out of bounds.

This commit also changes COFFDump in llvm-objdump to reuse the pointers
that are already range-checked in COFFObjectFile. This fixes a crash
when trying to dump the TLS directory from a stripped file.

Fixes https://github.com/mstorsjo/llvm-mingw/issues/284

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D126898
The file was addedllvm/test/Object/Inputs/COFF/dwarf-debug-only.yaml
The file was modifiedllvm/lib/Object/COFFObjectFile.cpp
The file was modifiedllvm/tools/llvm-objdump/COFFDump.cpp
The file was modifiedllvm/lib/Object/Error.cpp
The file was modifiedllvm/include/llvm/Object/COFF.h
The file was modifiedllvm/include/llvm/Object/Error.h
The file was addedllvm/test/Object/coff-dwarf-debug-only.test
Commit 3a252806f41b04da021de26111106f1a67f501a6 by benny.kra
[COFF] Fix -Wredundant-move
The file was modifiedllvm/lib/Object/COFFObjectFile.cpp
Commit 440285200265eca0e148cb838f83fa7cbc37c640 by craig.topper
[RISCV] Reduce scalar load/store isel patterns to a single ComplexPattern. NFCI

Previously we had 3 different isel patterns for every scalar load
store instruction.

This reduces them to a single ComplexPattern that returns the Base
and Offset. Or an offset of 0 if there was no offset identified

I've done a similar thing for the 2 isel patterns that match add/or
with FrameIndex and immediate. Using the offset of 0, I was also
able to remove the custom handler for FrameIndex. Happy to split that
to another patch.

We might be able to enhance in the future to remove the post-isel
peephole or the special handling for ADD with constant added by D126576.

A nice side effect is that this removes nearly 3000 bytes from the isel
table.

Differential Revision: https://reviews.llvm.org/D126932
The file was modifiedllvm/lib/Target/RISCV/RISCVISelDAGToDAG.h
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfo.td
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoA.td
The file was modifiedllvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
Commit 5904836b8a718554cef204bc9b248f051809ab6e by spupyrev
[BOLT] Cache-Aware Tail Duplication

A new "cache-aware" strategy for tail duplication.

Differential Revision: https://reviews.llvm.org/D123050
The file was modifiedbolt/test/X86/tail-duplication-prop-bug.s
The file was modifiedbolt/lib/Rewrite/BinaryPassManager.cpp
The file was addedbolt/test/X86/tail-duplication-cache.s
The file was modifiedbolt/test/X86/tail-duplication-complex.s
The file was modifiedbolt/test/X86/tail-duplication-jt.s
The file was modifiedbolt/include/bolt/Passes/TailDuplication.h
The file was modifiedbolt/test/X86/tail-duplication-pass.s
The file was modifiedbolt/lib/Passes/TailDuplication.cpp
The file was modifiedbolt/test/runtime/X86/tail-duplication-constant-prop.s
The file was modifiedbolt/test/X86/tail-duplication-cacheline.s
Commit dd6bcdbf21716c56d3defd7f4cacddc7befd5de1 by lgrey
[Attributes] Remove AttrSyntax and migrate uses to AttributeCommonInfo::Syntax (NFC)

This is setup for allowing hasAttribute to work for plugin-provided attributes

Differential Revision: https://reviews.llvm.org/D126902
The file was modifiedclang/lib/Basic/Attributes.cpp
The file was modifiedclang/include/clang/Basic/Attributes.h
The file was modifiedclang/lib/Lex/PPMacroExpansion.cpp
The file was modifiedclang/lib/Parse/ParseDeclCXX.cpp
The file was modifiedclang/utils/TableGen/ClangAttrEmitter.cpp
The file was modifiedclang/lib/Parse/ParseDecl.cpp
Commit 1a216dc8910fce676cf6787877a786c28cdf8c38 by ndesaulniers
llvm: cmake: set CMP0114 to OLD to avoid warning

Building with cmake 3.23.2+ produces warnings when using
LLVM_ENABLE_RUNTIMES. Set this policy to the existing behavior for now
to silence the warnings.

Fixes: https://github.com/llvm/llvm-project/issues/50122
Fixes: https://github.com/llvm/llvm-project/issues/54944

Reviewed By: phosek, penzn

Differential Revision: https://reviews.llvm.org/D126923
The file was modifiedllvm/CMakeLists.txt
Commit 1a729bce86173c9019545599c8a0771d0419ce9e by kda
[MSAN] add dn_expand intercept.

This interceptor only addresses writes to inputs.  Reads of inputs are not checked.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D126851
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
The file was addedcompiler-rt/test/sanitizer_common/TestCases/Linux/dn_expand.cpp
The file was addedcompiler-rt/test/msan/Linux/dn_expand.cpp
Commit 7e48dae5a1805303b0d546e3d060c7096a75d718 by fmayer
[LLVM] [NFC] remove unnecessary, confusing scope

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D126935
The file was modifiedllvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
Commit 95aff23e29214543360d893f9a61df0ebd1b65d2 by Krzysztof.Drewniak
Re-land "[mlir] Add integer range inference analysis""

This reverts commit 4e5ce2056e3e85f109a074e80bdd23a10ca2bed9.

This relands commit 1350c9887dca5ba80af8e3c1e61b29d6696eb240.

Reinstates the range analysis with the build issue fixed.

Differential Revision: https://reviews.llvm.org/D126926
The file was modifiedmlir/test/lib/Dialect/Test/TestOps.td
The file was modifiedmlir/include/mlir/Interfaces/CMakeLists.txt
The file was addedmlir/lib/Analysis/IntRangeAnalysis.cpp
The file was addedmlir/lib/Interfaces/InferIntRangeInterface.cpp
The file was modifiedmlir/test/lib/Dialect/Test/CMakeLists.txt
The file was modifiedmlir/test/lib/Dialect/Test/TestDialect.h
The file was modifiedmlir/test/lib/Dialect/Test/TestDialect.cpp
The file was addedmlir/unittests/Interfaces/InferIntRangeInterfaceTest.cpp
The file was addedmlir/include/mlir/Interfaces/InferIntRangeInterface.h
The file was addedmlir/test/lib/Transforms/TestIntRangeInference.cpp
The file was modifiedmlir/lib/Analysis/DataFlowAnalysis.cpp
The file was modifiedmlir/test/lib/Transforms/CMakeLists.txt
The file was modifiedmlir/tools/mlir-opt/mlir-opt.cpp
The file was modifiedmlir/lib/Interfaces/CMakeLists.txt
The file was addedmlir/include/mlir/Analysis/IntRangeAnalysis.h
The file was addedmlir/include/mlir/Interfaces/InferIntRangeInterface.td
The file was addedmlir/test/Interfaces/InferIntRangeInterface/infer-int-range-test-ops.mlir
The file was modifiedmlir/lib/Analysis/CMakeLists.txt
The file was modifiedmlir/unittests/Interfaces/CMakeLists.txt
Commit 0a832ba5c2ef01e91e4e79b2681b95b7dab18ead by rnk
[config] Remove LLVM_DEFAULT_TARGET_TRILE from config.h

It is redundant with llvm-config.h, which is always included by
config.h.

Port D12660 / d178f4fc895b432008fcd8a0a49a13d951fecfe4 from config.h to
llvm-config.h.

Update the gn build accordingly.

NFCI
The file was modifiedllvm/include/llvm/Config/llvm-config.h.cmake
The file was modifiedllvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
The file was modifiedllvm/include/llvm/Config/config.h.cmake
Commit 170c550ca8e3c4174db4c8332257376bdc869a1c by craig.topper
[RISCV] Use SelectionDAG::isBaseWithConstantOffset in scalar load/store address matching.

Test changes are because isBaseWithConstantOffset uses computeKnownBits
and that is able to see that an earlier AND instruction guaranteed
alignment so that we can treat an OR as an ADD.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D126970
The file was modifiedllvm/test/CodeGen/RISCV/vararg.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
Commit 436fef21efe35833622c71da705a9a50db246294 by python3kgae
[NFC] Fix issue on CMake Xcode build configuration.

add missing dependency for hlsl-resource-headers and clang-resource-headers.

Reviewed By: rastogishubham

Differential Revision: https://reviews.llvm.org/D126892
The file was modifiedclang/lib/Headers/CMakeLists.txt
Commit 21f2ac9a2f9586e704930182e43c3034d9ecf4af by kda
[MSAN] Exclude dn_expand test from Android.

Depends on 1a729bce8617

Differential Revision: https://reviews.llvm.org/D126981
The file was modifiedcompiler-rt/test/sanitizer_common/TestCases/Linux/dn_expand.cpp
Commit ef8e91826126a23e59a0241e1e3a1eba82db0202 by nikolasklauser
[libc++] Forward more often to memmove in copy

In D122982 I accidentally disabled the memmove optimization. This re-enables it and adds more cases where copy forwards to memmove.
Fixes https://github.com/llvm/llvm-project/issues/33687

Reviewed By: var-const, #libc, ldionne

Spies: pkasting, ayzhao, dcheng, xbolva00, libcxx-commits

Differential Revision: https://reviews.llvm.org/D124328
The file was modifiedlibcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_pointer.pass.cpp
The file was addedlibcxx/test/libcxx/algorithms/alg.modifying.operations/copy.pass.cpp
The file was modifiedlibcxx/include/__algorithm/copy.h
The file was modifiedlibcxx/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_string_view.pass.cpp
The file was modifiedlibcxx/include/__iterator/iterator_traits.h
Commit 8cc8b36f24d6f3133c44e238a657309620eedc19 by jingham
CommandObjectRegexCommand shouldn't put two commands on the history stack.

It was putting the command the user typed, and then the resolved command in the
command history.  That caused up-arrow not to work correctly when the regex command
was invoked from a Python-command.  Plus it's just weird.

Differential Revision: https://reviews.llvm.org/D126789
The file was modifiedlldb/source/Commands/CommandObjectRegexCommand.cpp
The file was modifiedlldb/test/API/functionalities/history/TestHistoryRecall.py
Commit dc63ad8878de6d0b5dc1268691f48035e9234763 by sam.mccall
[pseudo] Eliminate dependencies from clang-pseudo-gen. NFC

ClangBasic dependency eliminated by replacing our usage of
tok::getPunctuatorSpelling etc with direct use of the *.def file.

Implicit dependencies on clang-tablegen-targets removed as we manage to avoid
any transitive tablegen deps.

After these changes, `ninja clean; ninja pseudo-gen` runs 169 actions only
(basically Support and Demangle).

Differential Revision: https://reviews.llvm.org/D126731
The file was modifiedclang-tools-extra/pseudo/lib/grammar/Grammar.cpp
The file was modifiedclang-tools-extra/pseudo/lib/grammar/CMakeLists.txt
The file was modifiedclang-tools-extra/pseudo/gen/CMakeLists.txt
Commit 389c0b81d3bea7f6dddbe2ac6f07dd862f472e16 by benny.kra
[bazel] Port 95aff23e2921
The file was modifiedutils/bazel/llvm-project-overlay/mlir/BUILD.bazel
The file was modifiedutils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel
The file was modifiedutils/bazel/llvm-project-overlay/mlir/unittests/BUILD.bazel
Commit 87099a0438ade5cf0df1dda21183628ee3b49395 by sbc
[lld][WebAssembly] Remove unnecessary accessor methods. NFC

This is less code, and matches more closely the ELF linker.

Differential Revision: https://reviews.llvm.org/D126979
The file was modifiedlld/wasm/OutputSegment.cpp
The file was modifiedlld/wasm/SyntheticSections.cpp
The file was modifiedlld/wasm/InputChunks.cpp
The file was modifiedlld/wasm/Writer.cpp
The file was modifiedlld/wasm/InputChunks.h
Commit a43fef05d4fae32f02365c7b8fef2aa631d23628 by sam.mccall
[pseudo] rename pseudo-gen -> clang-pseudo-gen. NFC

This name is not namespaced. Requested in D126717

Differential Revision: https://reviews.llvm.org/D126725
The file was modifiedllvm/utils/gn/secondary/clang-tools-extra/pseudo/gen/BUILD.gn
The file was modifiedclang-tools-extra/pseudo/include/CMakeLists.txt
The file was modifiedclang-tools-extra/pseudo/gen/CMakeLists.txt
Commit 830d158d2b7d2fa45f39fe12aa0b2ffc70c7e771 by sam.mccall
[pseudo] Add CLANG_PSEUDO_GEN cmake cache variable to avoid nested CMake invocation

Similar to LLVM_TABLEGEN, CLANG_TABLEGEN variables

Differential Revision: https://reviews.llvm.org/D126717
The file was modifiedclang-tools-extra/pseudo/include/CMakeLists.txt