Changes

Summary

  1. Implement better path matching in FileSpecList::FindCompatibleIndex(...). (details)
  2. Partially revert "[llvm] Repair the modules build with C++17" (details)
  3. [llvm-profgen] Fix perf script parsing issues (details)
  4. [flang] Don't compute pointer component procedure characteristics when not needed (details)
  5. [mlir][tosa] Updates tosa.equal to use the InferTensorType interface (details)
  6. [X86] Add 64bits test cases for D131358 (details)
  7. [NFC][asan] Clang-format a file (details)
  8. [Clang] Allow downgrading to a warning the diagnostic for setting a non fixed enum to a value outside the range of the enumeration values (details)
  9. [NFC][asan] Add LIKELY/UNLIKELY on hot memcpy paths (details)
  10. [CMake] Build lib/gwp_asan/tests with -std=c++17 (details)
  11. [mlir][tosa] Use arith::maxf/arith::minf in lowering from tosa (details)
  12. [PowerPC] mapping hardward loop intrinsics to powerpc pseudo (details)
  13. [AArch64] Fix and add A64FX scheduling resource/latency info (details)
  14. [Driver] Add -Xclang= as an alias for -Xclang (details)
  15. [NFC][asan] Fix Condition annotation after 30bbb73bb448 (details)
  16. [asan] Avoid few branches on memcpy hot path (details)
  17. [LLDB] Remove undefined behavior in TestConstStaticIntegralMember.py (details)
  18. [lldb] Refactor Symbols::DownloadObjectAndSymbolFile (details)
  19. [mlir] LLVM_FALLTHROUGH => [[fallthrough]]. NFC (details)
  20. LLVM_FALLTHROUGH => [[fallthrough]]. NFC (details)
  21. [MachinePipeliner] Fix Phi generation failure for large stages (details)
  22. [NFC] fix warning (details)
  23. [Basic] Deprecate MapEntryOptionalStorage::{hasValue,getValue} (details)
  24. [llvm] Alternative attempt at fixing the modules build with C++17 (details)
  25. [asan] Faster version of QuickCheckForUnpoisonedRegion (details)
  26. [globalisel] Select register bank for DBG_VALUE (details)
  27. [llvm] Don't rely on C++17 deduction guide for array creation (details)
  28. [LoongArch] Add codegen support for bswap (details)
  29. [LoongArch] Implement branch analysis (details)
  30. [LoongArch] Add codegen support for not (details)
Commit c0124084537bad33180d2e675475baf1a4b79afe by gclayton
Implement better path matching in FileSpecList::FindCompatibleIndex(...).

Currently a FileSpecList::FindFileIndex(...) will only match the specified FileSpec if:
- it has filename and directory and both match exactly
- if has a filename only and any filename in the list matches

Because of this, we modify our breakpoint resolving so it can handle relative paths by doing some extra code that removes the directory from the FileSpec when searching if the path is relative.

This patch is intended to fix breakpoints so they work as users expect them to by adding the following features:
- allow matches to relative paths in the file list to match as long as the relative path is at the end of the specified path at valid directory delimiters
- allow matches to paths to match if the specified path is relative and shorter than the file paths in the list

This allows us to remove the extra logic from BreakpointResolverFileLine.cpp that added support for setting breakpoints with relative paths.

This means we can still set breakpoints with relative paths when the debug info contains full paths. We add the ability to set breakpoints with full paths when the debug info contains relative paths.

Debug info contains "./a/b/c/main.cpp", the following will set breakpoints successfully:
- /build/a/b/c/main.cpp
- a/b/c/main.cpp
- b/c/main.cpp
- c/main.cpp
- main.cpp
- ./c/main.cpp
- ./a/b/c/main.cpp
- ./b/c/main.cpp
- ./main.cpp

This also ensures that we won't match partial directory names, if a relative path is in the list or is used for the match, things must match at the directory level.

The breakpoint resolving code will now use the new FileSpecList::FindCompatibleIndex(...) function to allow this fuzzy matching to work for breakpoints.

Differential Revision: https://reviews.llvm.org/D130401
The file was addedlldb/unittests/Core/FileSpecListTest.cpp
The file was modifiedlldb/source/Core/FileSpecList.cpp
The file was modifiedlldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
The file was modifiedlldb/include/lldb/Core/FileSpecList.h
The file was modifiedlldb/include/lldb/Breakpoint/BreakpointResolverFileLine.h
The file was modifiedlldb/source/Symbol/CompileUnit.cpp
The file was modifiedlldb/source/Breakpoint/BreakpointResolverFileLine.cpp
The file was addedlldb/test/API/functionalities/breakpoint/breakpoint_command/relative.yaml
The file was modifiedlldb/unittests/Core/CMakeLists.txt
Commit 860efb10b42e71ac96d07ea3f45c1baf10ee3f09 by Jonas Devlieghere
Partially revert "[llvm] Repair the modules build with C++17"

This reverts commit db008af501534d4590542253ae3acf783986f5f7 because
this now breaks the non-module build...
The file was modifiedllvm/include/llvm/ADT/STLExtras.h
Commit 1b212d1098d264f2d5ccc17cde5492f9f2338df6 by wlei
[llvm-profgen] Fix perf script parsing issues

Fix two perf script parsing issues:

1) Redirect the error message to a new file. (the error message mixed in the perfscript could screw up the MMAP event line and cause a parsing failure)

2) Changed the MMap parsing error message to warning since the perfscript can still be parsed using the preferred address as base address.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D131449
The file was modifiedllvm/tools/llvm-profgen/PerfReader.cpp
Commit b8641bfc4c2d488c7a09a556728f10340d5c8819 by pklausler
[flang] Don't compute pointer component procedure characteristics when not needed

When a procedure pointer component has an interface that is a forward
reference to a procedure, syntax errors can be emitted if there is
a structure constructor that tries to initialize that component,
since its characteristics are not yet known; however, when the
initializer is a bare NULL(with no mold), those characteristics
don't matter.  Make the characterization of the procedure pointer
component take place only when needed.

Differential Revision: https://reviews.llvm.org/D131100
The file was modifiedflang/lib/Semantics/pointer-assignment.cpp
Commit b73e8325fb25b27f898190d81a0d62e92c06694c by jpienaar
[mlir][tosa] Updates tosa.equal to use the InferTensorType interface

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D130373
The file was modifiedmlir/lib/Dialect/Tosa/IR/TosaOps.cpp
The file was modifiedmlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
Commit 2264f7ef27a5dcc89e41fef4a7c734471011f6fd by deadalnix
[X86] Add 64bits test cases for D131358
The file was modifiedllvm/test/CodeGen/X86/or-lea.ll
Commit 67c06c4731bd50f77395144fde3865bf36f5a469 by Vitaly Buka
[NFC][asan] Clang-format a file
The file was modifiedcompiler-rt/lib/asan/asan_interceptors_memintrinsics.h
Commit cc104113ddecbdcec2cca848adbb6afa1214e9de by Shafik Yaghmour
[Clang] Allow downgrading to a warning the diagnostic for setting a non fixed enum to a value outside the range of the enumeration values

In D130058 we diagnose the undefined behavior of setting the value outside the
range of the enumerations values for an enum without a fixed underlying type.

Based on feedback we will provide users to the ability to downgrade this
diagnostic to a waring to allow for a transition period. We expect to turn this
diagnostic to an error in the next release.

Differential Revision: https://reviews.llvm.org/D131307
The file was modifiedclang/include/clang/Basic/DiagnosticASTKinds.td
The file was modifiedclang/lib/AST/ExprConstant.cpp
The file was modifiedclang/test/SemaCXX/constant-expression-cxx11.cpp
The file was modifiedclang/test/SemaCXX/MicrosoftCompatibility.cpp
The file was modifiedclang/docs/ReleaseNotes.rst
The file was modifiedclang/test/SemaCXX/compare.cpp
Commit 30bbb73bb448910f791088bfc3154e752d42241a by Vitaly Buka
[NFC][asan] Add LIKELY/UNLIKELY on hot memcpy paths
The file was modifiedcompiler-rt/lib/asan/asan_interceptors_memintrinsics.h
Commit 474145c0b2420cb316bb8a9dcc031d613679d496 by i
[CMake] Build lib/gwp_asan/tests with -std=c++17

With the recent llvm-project C++17 switch (D130689), gwp_asan/tests may fail to
link with some versions of GCC (https://github.com/llvm/llvm-project/issues/56994):

> backtrace.cpp:(.text+0xca6): undefined reference to `gwp_asan::AllocationMetadata::kMaxTraceLengthToCollect'

I cannot reproduce this issue by myself, but notice that currently
lib/gwp_asan/*.cpp get -std=c++17 while lib/gwp_asan/tests/*.cpp don't
(therefore may use -std=g++14 default from Clang and older GCC). Using -std=c++17
for lib/gwp_asan/tests will ensure that backtrace.cpp uses inline variable and will assuredly avoid the
possible GCC issue.

In the long-term, we should add -std=c++17 to a central place like generate_compiler_rt_tests.

Reviewed By: dyung

Differential Revision: https://reviews.llvm.org/D131440
The file was modifiedcompiler-rt/lib/gwp_asan/tests/CMakeLists.txt
Commit 2eb50cee11ccbfac71eeb7687b9f136d95fc7f52 by thomasraoux
[mlir][tosa] Use arith::maxf/arith::minf in lowering from tosa

now that `arith` dialect has maxf/minf use it instead of cmp/select.
Also refactor clamp helpers to make them simlper.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D131426
The file was modifiedmlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
The file was modifiedmlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
The file was modifiedmlir/include/mlir/Dialect/Tosa/Utils/CoversionUtils.h
The file was modifiedmlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp
The file was modifiedmlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
Commit d9004dfbabc62887f09775297436792077ce4496 by czhengsz
[PowerPC] mapping hardward loop intrinsics to powerpc pseudo

Map hardware loop intrinsics loop_decrement and set_loop_iteration
to the new PowerPC pseudo instructions, so that the hardware loop
intrinsics will be expanded to normal cmp+branch form or ctrloop
form based on the CTR register usage on MIR level.

Reviewed By: lkail

Differential Revision: https://reviews.llvm.org/D123366
The file was modifiedllvm/test/CodeGen/PowerPC/sms-phi.ll
The file was modifiedllvm/lib/Target/PowerPC/PPCInstr64Bit.td
The file was modifiedllvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
The file was modifiedllvm/test/CodeGen/PowerPC/ctrloops64.mir
The file was modifiedllvm/lib/Target/PowerPC/PPCISelLowering.cpp
The file was modifiedllvm/test/CodeGen/PowerPC/ctrloops-pseudo.ll
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrInfo.td
The file was modifiedllvm/lib/Target/PowerPC/PPCCTRLoops.cpp
The file was modifiedllvm/test/CodeGen/PowerPC/ctrloops32.mir
Commit 3f561996bf7193091bc6670a2e7804b0cb0bb936 by t-kawashima
[AArch64] Fix and add A64FX scheduling resource/latency info

1. Missing instruction information (FTSSEL, FMSB, PFIRST and RDFFR)
   is added and CompleteModel is set to one.

2. Information for pseudo SVE instructions is added. Those
   instructions are present at the time of scheduling.

3. Resource and latency information for SVE instructions is modified
   to be more accurate.
   For example, the description for CMPEQ, which consumes one cycle
   each of unit FLA and PPR, is as follows.
```
Previous:
  def A64FXGI01 : ProcResGroup<[A64FXIPFLA, A64FXIPPR]>;
  def A64FXWrite_4Cyc_GI01 : SchedWriteRes<[A64FXGI01]> {...
Modified:
  def A64FXGI0 : ProcResGroup<[A64FXIPFLA]>;
  def A64FXGI1 : ProcResGroup<[A64FXIPPR]>;
  def A64FXWrite_CMP : SchedWriteRes<[A64FXGI0, A64FXGI1]> {...
```

Reference: A64FX Microarchitecture Manual (Table 16-3)
https://github.com/fujitsu/A64FX/blob/master/doc/A64FX_Microarchitecture_Manual_en_1.7.pdf

Reviewed By: dmgreen, kawashima-fj

Differential Revision: https://reviews.llvm.org/D131165
The file was modifiedllvm/lib/Target/AArch64/AArch64SchedA64FX.td
The file was addedllvm/test/tools/llvm-mca/AArch64/A64FX/A64-basic-instructions.s
The file was addedllvm/test/tools/llvm-mca/AArch64/A64FX/A64FX-sve-instructions.s
The file was addedllvm/test/tools/llvm-mca/AArch64/A64FX/A64FX-neon-instructions.s
Commit 8d9d27db475943954fce00db47f8c9daf4dae600 by i
[Driver] Add -Xclang= as an alias for -Xclang

Driver options taking a value typically use `=` as the separator, instead of a
space. Unfortunately many older driver options do not stick with the rule, but I
find -Xclang used a lot and will be convenient if -Xclang= exists.

For build systems using a string array instead of a string to indicate compiler options,
`["-Xclang=-foo"]` is more convenient than `["-Xclang", "-foo"]`.
If a tool wants to filter out -Xclang=-foo, it is trivial for the `=` form, but
complex for the space separated form.

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D131455
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/test/Driver/disable-llvm.c
Commit 341ee9c0294f368aba83712651d34f6a4bbe92f3 by Vitaly Buka
[NFC][asan] Fix Condition annotation after 30bbb73bb448
The file was modifiedcompiler-rt/lib/asan/asan_interceptors_memintrinsics.h
Commit 03e345b5198d22ac7a4fd9798010fd1da16a25ca by Vitaly Buka
[asan] Avoid few branches on memcpy hot path
The file was modifiedcompiler-rt/lib/asan/asan_internal.h
The file was modifiedcompiler-rt/lib/asan/asan_interceptors_memintrinsics.h
The file was modifiedcompiler-rt/lib/asan/asan_rtl.cpp
Commit 1438639a2f7eb9e9cba01454d3a9b1b16d179c9a by Shafik Yaghmour
[LLDB] Remove undefined behavior in TestConstStaticIntegralMember.py

Setting an enum without a fixed underlying type to a value which is outside the
value range is undefined behavior.

The initializer needs to be a constant expression and therefore this was always
ill-formed we just were not diagnosing it before.

See D130058 and D131307 for more details.

Differential Revision: https://reviews.llvm.org/D131460
The file was modifiedlldb/test/API/lang/cpp/const_static_integral_member/main.cpp
The file was modifiedlldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
Commit bd3976fed470343be8df9caf0e35d290455b700c by Jonas Devlieghere
[lldb] Refactor Symbols::DownloadObjectAndSymbolFile

- Reduce indentation
- Extract caching of the DbgShellCommand and the dsymForUUID executable
   (or equivalent)
- Check the DBGShellCommands before falling back to
   /usr/local/bin/dsymForUUID
- Don't check ~rc/bin/dsymForUUID
- Improve error reporting
- Don't cache the value of LLDB_APPLE_DSYMFORUUID_EXECUTABLE

Differential revision: https://reviews.llvm.org/D131303
The file was modifiedlldb/source/Symbol/LocateSymbolFileMacOSX.cpp
Commit fc63c0542c8d6e5be07e059d03a73ae77f5155aa by i
[mlir] LLVM_FALLTHROUGH => [[fallthrough]]. NFC
The file was modifiedmlir/lib/AsmParser/Parser.cpp
The file was modifiedmlir/lib/Tools/PDLL/Parser/Lexer.cpp
The file was modifiedmlir/lib/IR/AffineExpr.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
The file was modifiedmlir/lib/AsmParser/Lexer.cpp
The file was modifiedmlir/lib/Transforms/Utils/DialectConversion.cpp
Commit 0972a390b9c74cd994ad0250cf392aecb67502a3 by i
LLVM_FALLTHROUGH => [[fallthrough]]. NFC
The file was modifiedclang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
The file was modifiedopenmp/libomptarget/plugins/cuda/src/rtl.cpp
The file was modifiedpolly/lib/Analysis/ScopDetection.cpp
The file was modifiedclang-tools-extra/clang-include-fixer/FuzzySymbolIndex.cpp
The file was modifiedclang-tools-extra/clangd/CodeComplete.cpp
The file was modifiedclang-tools-extra/clangd/SourceCode.cpp
The file was modifiedpolly/lib/Transform/ForwardOpTree.cpp
The file was modifiedbolt/lib/Passes/FrameAnalysis.cpp
The file was modifiedpolly/lib/Support/VirtualInstruction.cpp
The file was modifiedbolt/lib/Passes/RegReAssign.cpp
The file was modifiedclang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp
The file was modifiedclang-tools-extra/clang-tidy/readability/FunctionSizeCheck.cpp
The file was modifiedbolt/lib/Passes/ShrinkWrapping.cpp
The file was modifiedpolly/lib/Analysis/ScopBuilder.cpp
The file was modifiedbolt/lib/Target/X86/X86MCPlusBuilder.cpp
Commit 5357dd2f43a5aab28f34b69e7d3742dd50cbad98 by t-kawashima
[MachinePipeliner] Fix Phi generation failure for large stages

The previous code overwrites VRMap for prologue stages during Phi
generation if a register spans many stages.
As a result, the wrong register is used as the one coming from
the prologue in Phis at later stages. (A process exists to correct
this, but it does not work in all cases.)
In addition, VRMap for prologue must be preserved until addBranches().

This patch fixes them by separating the map for Phis into a different
variable (VRMapPhi).

Reviewed By: bcahoon

Differential Revision: https://reviews.llvm.org/D127840
The file was modifiedllvm/include/llvm/CodeGen/ModuloSchedule.h
The file was addedllvm/test/CodeGen/PowerPC/sms-large-stages.mir
The file was modifiedllvm/lib/CodeGen/ModuloSchedule.cpp
Commit 22e475f5ac237dfebbb3cd2b3306a17d3b2a53ce by czhengsz
[NFC] fix warning
The file was modifiedllvm/lib/Target/PowerPC/PPCCTRLoops.cpp
Commit 8e207e4c096e89fa5410b519715aba8c20701061 by kazu
[Basic] Deprecate MapEntryOptionalStorage::{hasValue,getValue}

MapEntryOptionalStorage is an underlying storage class for
OptionalStorage<clang::DirectoryEntryRef>.

This patch deprecates:

  OptionalStorage<clang::DirectoryEntryRef>::hasValue
  OptionalStorage<clang::DirectoryEntryRef>::getValue

as there is no known users of these two methods.

Differential Revision: https://reviews.llvm.org/D131368
The file was modifiedclang/include/clang/Basic/DirectoryEntry.h
Commit 2db6b34ea8136b02ef533268f0324541c7f93d95 by Jonas Devlieghere
[llvm] Alternative attempt at fixing the modules build with C++17

My initial attempt in db008af50153 resulted in "error: no viable
constructor or deduction guide for deduction of template arguments of
'array'". Let's see if we can work around that by using an ArrayRef with
an explicit template argument.
The file was modifiedllvm/include/llvm/ADT/STLExtras.h
Commit ea42515dadfa3ca0020bc7107787761f026ad2dc by Vitaly Buka
[asan] Faster version of QuickCheckForUnpoisonedRegion

Slightly helps with performance regression after D128146.
The file was modifiedcompiler-rt/lib/asan/asan_interceptors_memintrinsics.h
Commit aaf6c7b05c9d155c8d34ec06a2f76ebdef8d21b9 by yuanke.luo
[globalisel] Select register bank for DBG_VALUE

The register operand of DBG_VALUE is not selected to a proper register
bank in both AArch64 and X86. This would cause getRegClass crash after
global ISel. After discussion, we think the MIR should assume all
vritual register should be set proper register class after global ISel,
so this patch is to fix the gap of DBG_VALUE for AArch64 and X86.

Differential Revision: https://reviews.llvm.org/D129037
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
The file was modifiedllvm/lib/CodeGen/RegisterBankInfo.cpp
The file was modifiedllvm/test/DebugInfo/AArch64/debug-reg-bank.ll
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-hint.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp
The file was modifiedllvm/lib/Target/X86/X86RegisterBankInfo.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-dbg-value.mir
The file was modifiedllvm/test/DebugInfo/X86/debug-reg-bank.ll
The file was modifiedllvm/lib/Target/X86/X86InstructionSelector.cpp
Commit e8c807fade5ff75ffe7f1395c20cfda0bc9480e3 by Jonas Devlieghere
[llvm] Don't rely on C++17 deduction guide for array creation

Seems like at least one bot (clang-ppc64-aix) is having trouble with the
C++17 deduction guide for array creation. Specify the template arguments
explicitly.
The file was modifiedllvm/include/llvm/Support/FormatProviders.h
Commit f35cb7ba344b4de654c78f8a8d63a455e52588aa by luweining
[LoongArch] Add codegen support for bswap

Differential Revision: https://reviews.llvm.org/D131352
The file was modifiedllvm/lib/Target/LoongArch/LoongArchISelLowering.h
The file was modifiedllvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
The file was modifiedllvm/lib/Target/LoongArch/LoongArchInstrInfo.td
The file was addedllvm/test/CodeGen/LoongArch/bswap.ll
Commit 8716513e65c4e8eb0530579e3a15e44de88c3b9a by luweining
[LoongArch] Implement branch analysis

This allows a number of optimisation passes to work.
E.g. BranchFolding and MachineBlockPlacement.

Differential Revision: https://reviews.llvm.org/D131316
The file was modifiedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/loongarch_generated_funcs.ll.generated.expected
The file was modifiedllvm/lib/Target/LoongArch/LoongArchInstrInfo.h
The file was modifiedllvm/test/CodeGen/LoongArch/ir-instruction/br.ll
The file was modifiedllvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/loongarch_generated_funcs.ll.nogenerated.expected
The file was addedllvm/test/CodeGen/LoongArch/analyze-branch.ll
The file was modifiedllvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp
Commit d3580c2eb6ec95256a65ce7f66346351e9852eab by luweining
[LoongArch] Add codegen support for not

Differential Revision: https://reviews.llvm.org/D131384
The file was modifiedllvm/test/CodeGen/LoongArch/calling-conv-lp64d.ll
The file was modifiedllvm/lib/Target/LoongArch/LoongArchInstrInfo.td
The file was addedllvm/test/CodeGen/LoongArch/not.ll