FailedChanges

Summary

  1. [lsan] On Fuchsia, don't use atexit hook for leak checks (details)
  2. [gn build] Allow option to build with asan/tsan/ubsan (details)
  3. [mlir][OpFormatGen] Update "custom" directives for attributes. (details)
  4. [AArch64][SVE] Fix frame offset calculation when d8 is saved. (details)
  5. Add `breakpoint delete --disabled`: deletes all disabled breakpoints. (details)
  6. [AMDGPU] Make ds fp atomics overloadable (details)
  7. [IRSim] Adding IRSimilarityCandidate that contains a region of IRInstructionData. (details)
  8. [PowerPC][PCRelative] Thread Local Storage Support for Local Dynamic (details)
  9. asan: Use `#if` to test CAN_SANITIZE_LEAKS (details)
  10. [scudo][standalone] Fix tests under ASan/UBSan (details)
  11. Revert "[lsan] On Fuchsia, don't use atexit hook for leak checks" (details)
  12. [AArch64][SVE] Add lowering for llvm frecpx (details)
  13. Allow init_priority values <= 100 and > 65535 within system headers. (details)
  14. [lldb] Normalize paths in new test (details)
  15. [LoopTerminology][NFC] Fix formatting typo (details)
  16. Clean up test file, NFC (details)
  17. [PowerPC] Implement Vector signed/unsigned __int128 overloads for the comparison builtins (details)
  18. [PowerPC] Implement the 128-bit vec_[all|any]_[eq | ne | lt | gt | le | ge] builtins in Clang/LLVM (details)
  19. Recommit [NFC] Refactor DiagnosticBuilder and PartialDiagnostic (details)
  20. [AArch64] Expand some vector of i64 reductions on NEON (details)
  21. [SelectionDAG][GISel] Make LegalizeDAG lower FNEG using integer ops. (details)
  22. [JSON] Allow emitting comments in json::OStream (details)
  23. [lld-macho] cleanup unimplemented-option warnings (details)
  24. [X86] Add a memory clobber to the bittest intrinsic inline asm. Get default clobbers from the target (details)
  25. [lld-macho] handle options -search_paths_first, -search_dylibs_first (details)
  26. [JSON] Facility to track position within an object and report errors. (details)
  27. [NewPM][MSSA] Fix failures under NPM due to -enable-mssa-loop-dependency (details)
  28. [NewPM][CGSCC] Handle newly added functions in updateCGAndAnalysisManagerForPass (details)
  29. [NewPM] Add callbacks to PassBuilder to run before/after parsing a pass (details)
  30. [JSON] Display errors associated with Paths in context (details)
  31. [libunwind] Combine dl_iterate_phdr codepaths for DWARF and EHABI (details)
  32. [libunwind] Optimize dl_iterate_phdr's findUnwindSectionsByPhdr (details)
  33. [JSON] Add error reporting to fromJSON and ObjectMapper (details)
  34. Fix LLDB tweak in 62a47e994fcf5b73e29547d26cd9676b30cb69a3 (details)
  35. [libc++] Fix spurious test failure in -fno-exceptions (details)
  36. [clangd] Improve bad-RPC-payload error messages slightly (details)
  37. [CGProfile] don't emit cgprofile entry if called function is dllimport (details)
  38. Explicitly specify CMAKE_AR in WinMsvc.cmake (details)
  39. Utility: ignore OS version on non-Darwin targets in `ArchSpec` (details)
  40. [X86] Add TDX instructions. (details)
  41. [X86] Parse data32 call in .code16 as CALLpcrel32 (details)
  42. Revert "[NewPM] Add callbacks to PassBuilder to run before/after parsing a pass" (details)
  43. [AMDGPU] Consider all SGPR uses as unique in constant bus verify (details)
  44. [NFC] Remove unnecessary default constructors (details)
  45. [GlobalISel][AMDGPU] Lower G_SMULH/G_UMULH (details)
  46. [lld-macho] Initial support for common symbols (details)
  47. [lld-macho] Implement and test resolution of common symbols (details)
  48. [lld-macho] Emit indirect symbol table (details)
  49. [lld-macho] Ignore `-mllvm` and its argument (details)
  50. [lld-macho] Support -weak_lx, -weak_library, -weak_framework (details)
  51. [lld-macho][NFC] Refactor syslibroot / library path lookup (details)
Commit 0caad9fe441d5ee562e96d8b30b5574b492a933a by mcgrathr
[lsan] On Fuchsia, don't use atexit hook for leak checks

Fuchsia's system libraries are instrumented and use the lsan
allocator for internal purposes.  So leak checking needs to run
after all atexit hooks and after the system libraries' internal
exit-time hooks.  The <zircon/sanitizer.h> hook API calls the
__sanitizer_process_exit_hook function at exactly the right time.

Reviewed By: vitalybuka, phosek

Differential Revision: https://reviews.llvm.org/D86171
The file was modifiedcompiler-rt/lib/lsan/lsan_common_fuchsia.cpp
The file was modifiedcompiler-rt/lib/lsan/lsan_fuchsia.cpp
The file was modifiedcompiler-rt/lib/asan/asan_posix.cpp
The file was modifiedcompiler-rt/lib/lsan/lsan.cpp
The file was modifiedcompiler-rt/lib/lsan/lsan.h
The file was modifiedcompiler-rt/lib/asan/asan_internal.h
The file was modifiedcompiler-rt/lib/asan/asan_rtl.cpp
The file was modifiedcompiler-rt/lib/asan/asan_win.cpp
The file was modifiedcompiler-rt/lib/lsan/lsan_posix.cpp
The file was modifiedcompiler-rt/lib/asan/asan_fuchsia.cpp
Commit 11a75e6c92c9bde26f3c925b25135c2461afac1c by aeubanks
[gn build] Allow option to build with asan/tsan/ubsan

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D88056
The file was modifiedllvm/utils/gn/build/BUILD.gn
The file was modifiedllvm/utils/gn/build/buildflags.gni
Commit d14cfe10341681d18edf05ac98da2c5241b0864e by joker.eph
[mlir][OpFormatGen] Update "custom" directives for attributes.

This tweaks the generated code for parsing attributes with a custom
directive to call `addAttribute` on the `OperationState` directly,
and adds a newline after this call. Previously, the generated code
would call `addAttribute` on the `OperationState` field `attributes`,
which has no such method and fails to compile. Furthermore, the lack
of newline would generate code with incorrectly formatted single line
`if` statements. Added tests for parsing and printing attributes with
a custom directive.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D87860
The file was modifiedmlir/test/lib/Dialect/Test/TestOps.td
The file was modifiedmlir/test/mlir-tblgen/op-format.mlir
The file was modifiedmlir/tools/mlir-tblgen/OpFormatGen.cpp
The file was modifiedmlir/test/lib/Dialect/Test/TestDialect.cpp
Commit b92d084910b9febdafb9e701af6b73ddb7cac5af by efriedma
[AArch64][SVE] Fix frame offset calculation when d8 is saved.

If d8 is saved, the fp is not actually adjacent to the SVE
spills/allocations.  Fix the offset calculation to account for this.

Differential Revision: https://reviews.llvm.org/D88117
The file was modifiedllvm/test/CodeGen/AArch64/framelayout-sve.mir
The file was modifiedllvm/lib/Target/AArch64/AArch64FrameLowering.cpp
Commit 3726ac41e9e00d2f6f87779b68f91ea264223c8a by jingham
Add `breakpoint delete --disabled`: deletes all disabled breakpoints.

Differential Revision: https://reviews.llvm.org/D88129
The file was modifiedlldb/test/API/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
The file was modifiedlldb/source/Commands/CommandObjectBreakpoint.cpp
The file was modifiedlldb/source/Commands/Options.td
Commit 59691dc8740c7eada7fcf5552e0d2377780c6fb7 by Stanislav.Mekhanoshin
[AMDGPU] Make ds fp atomics overloadable

Differential Revision: https://reviews.llvm.org/D87947
The file was modifiedclang/test/CodeGenCUDA/builtins-amdgcn.cu
The file was modifiedclang/test/CodeGenOpenCL/builtins-amdgcn-vi.cl
The file was modifiedllvm/include/llvm/IR/IntrinsicsAMDGPU.td
The file was modifiedllvm/test/CodeGen/AMDGPU/lds_atomic_f32.ll
The file was modifiedclang/lib/CodeGen/CGBuiltin.cpp
Commit 6ada9e516f495eb6aa63e0c3e3edf3e3ae3c1a63 by andrew.litteken
[IRSim] Adding IRSimilarityCandidate that contains a region of IRInstructionData.

The IRSimilarityCandidate is a container to hold a region of
IRInstructions and offer interfaces for the starting instruction, ending
instruction, parent function, length.  It also assigns a global value
number for each unique instance of a value in the region.

It also contains an interface to compare two IRSimilarity as to whether
they have the same sequence of similar instructions.

Tests for whether the instructions are similar are found in
unittests/Analysis/IRSimilarityIdentifierTest.cpp.

Recommit of: 4944bb190fed8861d4d043eaf45e3c1e12aa2dc5

Differential Revision: https://reviews.llvm.org/D86970
The file was modifiedllvm/lib/Analysis/IRSimilarityIdentifier.cpp
The file was modifiedllvm/include/llvm/Analysis/IRSimilarityIdentifier.h
The file was modifiedllvm/unittests/Analysis/IRSimilarityIdentifierTest.cpp
Commit 652a8f150d4903abb53697ef1762026c6f5e716c by wei.huang
[PowerPC][PCRelative] Thread Local Storage Support for Local Dynamic

This patch is the initial support for the Local Dynamic Thread Local Storage
model to produce code sequence and relocation correct to the ABI for the model
when using PC relative memory operations.

Differential Revision: https://reviews.llvm.org/D87721
The file was addedllvm/test/CodeGen/PowerPC/pcrel-tls-local-dynamic.ll
The file was modifiedllvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCISelLowering.h
The file was modifiedllvm/lib/Target/PowerPC/PPCISelLowering.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCInstr64Bit.td
The file was modifiedllvm/include/llvm/BinaryFormat/ELFRelocs/PowerPC64.def
The file was modifiedllvm/lib/Target/PowerPC/PPCMCInstLower.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCTLSDynamicCall.cpp
The file was addedllvm/test/MC/PowerPC/pcrel-tls-local-dynamic-reloc.s
The file was modifiedllvm/lib/MC/MCExpr.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrInfo.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPC.h
The file was modifiedllvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
The file was modifiedllvm/include/llvm/MC/MCExpr.h
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrInfo.td
The file was modifiedllvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
Commit c96d0cceb684fa176b51d7df5f4f8370e2c983f4 by mcgrathr
asan: Use `#if` to test CAN_SANITIZE_LEAKS

The `if (0)` isn't necessarily optimized out so as not to create
a link-time reference to LSan runtime functions that might not
exist.  So use explicit conditional compilation instead.

Reviewed By: phosek

Differential Revision: https://reviews.llvm.org/D88173
The file was modifiedcompiler-rt/lib/asan/asan_rtl.cpp
The file was modifiedcompiler-rt/lib/lsan/lsan_common_fuchsia.cpp
Commit 2efc09c90914a6c887cb772130d6b375a1713472 by kostyak
[scudo][standalone] Fix tests under ASan/UBSan

Fix a potential UB in `appendSignedDecimal` (with -INT64_MIN) by making
it a special case.

Fix the terrible test cases for `isOwned`: I was pretty sloppy on those
and used some stack & static variables, but since `isOwned` accesses
memory prior to the pointer to check for the validity of the Scudo
header, it ended up being detected as some global and stack buffer out
of bounds accesses. So not I am using buffers with enough room so that
the test will not access memory prior to the variables.

With those fixes, the tests pass on the ASan+UBSan Fuchsia build.

Thanks to Roland for pointing those out!

Differential Revision: https://reviews.llvm.org/D88170
The file was modifiedcompiler-rt/lib/scudo/standalone/string_utils.cpp
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/combined_test.cpp
Commit f161e84c10b6eb2255345ebfaaa2bbadb4b0fe2a by nikita.ppv
Revert "[lsan] On Fuchsia, don't use atexit hook for leak checks"

This reverts commit 0caad9fe441d5ee562e96d8b30b5574b492a933a.
This reverts commit c96d0cceb684fa176b51d7df5f4f8370e2c983f4.

Causes linker errors which were not fixed by the subsequent commit
either:

/home/nikic/llvm-project/compiler-rt/lib/asan/asan_rtl.cpp:503: error: undefined reference to '__asan::InstallAtExitCheckLeaks()'
The file was modifiedcompiler-rt/lib/lsan/lsan_posix.cpp
The file was modifiedcompiler-rt/lib/lsan/lsan.cpp
The file was modifiedcompiler-rt/lib/asan/asan_rtl.cpp
The file was modifiedcompiler-rt/lib/asan/asan_fuchsia.cpp
The file was modifiedcompiler-rt/lib/asan/asan_internal.h
The file was modifiedcompiler-rt/lib/lsan/lsan_fuchsia.cpp
The file was modifiedcompiler-rt/lib/lsan/lsan_common_fuchsia.cpp
The file was modifiedcompiler-rt/lib/lsan/lsan.h
The file was modifiedcompiler-rt/lib/asan/asan_posix.cpp
The file was modifiedcompiler-rt/lib/asan/asan_win.cpp
Commit 3a76de42753e351311193ec1f729117b96a7bd9a by muhammad.asif.manzoor
[AArch64][SVE] Add lowering for llvm frecpx

Add the functionality to lower frecpx for passthru variant

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D88032
The file was modifiedllvm/lib/Target/AArch64/SVEInstrFormats.td
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.h
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
Commit af1d3e655991e5f0c86df372b8583a60d20268e0 by aaron
Allow init_priority values <= 100 and > 65535 within system headers.

This also adds some bare-bones documentation for the attribute rather
than leaving it undocumented.
The file was modifiedclang/test/SemaCXX/init-priority-attr.cpp
The file was modifiedclang/include/clang/Basic/Attr.td
The file was modifiedclang/include/clang/Basic/AttrDocs.td
The file was modifiedclang/lib/Sema/SemaDeclAttr.cpp
Commit 4a55c98fa7bee1e5ab1504db20ca4d7c8a083111 by jotrem
[lldb] Normalize paths in new test

The minidump-sysroot test I added in commit 20f84257 compares two paths
using a string comparison.  This causes the Windows buildbot to fail
because of mismatched forward slashes and backslashes.  Use
os.path.normcase to normalize before comparing.
The file was modifiedlldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
Commit 7aa982a57ce0dbf8fdbd276004615ddcf729c906 by sdi1600105
[LoopTerminology][NFC] Fix formatting typo
The file was modifiedllvm/docs/LoopTerminology.rst
Commit 57f097420d43adf3f38d66b31ed4ef49da62ae75 by kparzysz
Clean up test file, NFC
The file was modifiedllvm/test/Transforms/EarlyCSE/getmatchingvalue-crash.ll
Commit 88cdbeab417cc716d1da2de2a508d24622f4a4bc by conanap
[PowerPC] Implement Vector signed/unsigned __int128 overloads for the comparison builtins

This patch implements Vector signed/unsigned __int128 overloads for the comparison builtins.

Differential Revision: https://reviews.llvm.org/D87804
The file was addedllvm/test/CodeGen/PowerPC/vec_cmpq.ll
The file was modifiedclang/include/clang/Basic/BuiltinsPPC.def
The file was modifiedllvm/lib/Target/PowerPC/PPCISelLowering.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
The file was modifiedllvm/include/llvm/IR/IntrinsicsPowerPC.td
The file was modifiedclang/lib/Headers/altivec.h
The file was modifiedclang/test/CodeGen/builtins-ppc-p10vector.c
Commit 2e7117f847708d2fd1ff2d2961c3439470532b80 by conanap
[PowerPC] Implement the 128-bit vec_[all|any]_[eq | ne | lt | gt | le | ge] builtins in Clang/LLVM

This patch implements the vec_[all|any]_[eq | ne | lt | gt | le | ge] builtins for vector signed/unsigned __int128.

Differential Revision: https://reviews.llvm.org/D87910
The file was modifiedllvm/test/CodeGen/PowerPC/vec_cmpq.ll
The file was modifiedclang/lib/CodeGen/CGExprScalar.cpp
The file was modifiedclang/include/clang/Basic/BuiltinsPPC.def
The file was modifiedclang/lib/Headers/altivec.h
The file was modifiedclang/test/CodeGen/builtins-ppc-p10vector.c
The file was modifiedllvm/include/llvm/IR/IntrinsicsPowerPC.td
The file was modifiedllvm/lib/Target/PowerPC/PPCISelLowering.cpp
Commit 8e780a1653e6f87755a447e921b8f929d8b70996 by Yaxun.Liu
Recommit [NFC] Refactor DiagnosticBuilder and PartialDiagnostic

This recommits 829d14ee0a6aa79c89f7f3d9fcd9d27d3efd2b91.

The patch was reverted due to a regression in some CUDA app
which was thought to be caused by this patch. However, investigation
showed that the regression was due to some other issues, therefore
recommit this patch.
The file was modifiedclang/lib/Basic/Diagnostic.cpp
The file was modifiedclang/include/clang/AST/TemplateName.h
The file was modifiedclang/lib/AST/DeclCXX.cpp
The file was modifiedclang/include/clang/AST/DeclarationName.h
The file was modifiedclang/lib/AST/TemplateName.cpp
The file was modifiedclang/include/clang/AST/NestedNameSpecifier.h
The file was modifiedclang/include/clang/AST/Decl.h
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/include/clang/Basic/PartialDiagnostic.h
The file was modifiedclang/include/clang/AST/TemplateBase.h
The file was modifiedclang/include/clang/Basic/Diagnostic.h
The file was modifiedclang/include/clang/AST/CanonicalType.h
The file was modifiedclang/lib/AST/TemplateBase.cpp
The file was modifiedclang/include/clang/AST/ASTContext.h
The file was modifiedclang/include/clang/Sema/Ownership.h
The file was modifiedclang/include/clang/AST/Attr.h
The file was modifiedclang/include/clang/AST/Type.h
The file was modifiedclang/include/clang/AST/DeclCXX.h
The file was modifiedclang/lib/AST/ASTContext.cpp
The file was modifiedclang/include/clang/Sema/ParsedAttr.h
Commit e8413ac97f6ca2b1897cc9555ad9b0194456629f by mcinally
[AArch64] Expand some vector of i64 reductions on NEON

With the exception of VECREDUCE_ADD, there are no NEON instructions to support vector of i64 reductions. This patch removes the Custom lowerings for those and adds some test coverage to confirm.

Differential Revision: https://reviews.llvm.org/D88161
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/AArch64/vecreduce-umax-legalization.ll
The file was modifiedllvm/test/CodeGen/AArch64/aarch64-addv.ll
Commit 3f739f736b8fed6f4d63569f56c985ef04b21cd1 by efriedma
[SelectionDAG][GISel] Make LegalizeDAG lower FNEG using integer ops.

Previously, if a floating-point type was legal, but FNEG wasn't legal,
we would use FSUB.  Instead, we should use integer ops, to preserve the
semantics.  (Alternatively, there's a compiler-rt call we could use, but
there isn't much reason to use that.)

It turns out we actually are still using this obscure codepath in a few
cases: on some targets, we have "legal" floating-point types that don't
actually support any floating-point operations.  In particular, ARM and
AArch64 are using this path.

The implementation for SelectionDAG is pretty simple because we can
reuse the infrastructure from FCOPYSIGN.

See also 9a3dc3e, the corresponding change to type legalization.

Also includes a "bonus" change to STRICT_FSUB legalization, so we can
lower a STRICT_FSUB to a float libcall.

Includes the changes to both LegalizeDAG and GlobalISel so we don't have
inconsistent results in the future.

Fixes https://bugs.llvm.org/show_bug.cgi?id=46792 .

Differential Revision: https://reviews.llvm.org/D84287
The file was modifiedllvm/test/CodeGen/Thumb2/mve-fp-negabs.ll
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
The file was modifiedllvm/lib/Target/ARM/ARMLegalizerInfo.cpp
The file was modifiedllvm/test/CodeGen/AArch64/arm64-fp128.ll
The file was modifiedllvm/test/CodeGen/ARM/GlobalISel/arm-legalize-fp.mir
The file was modifiedllvm/test/CodeGen/X86/GlobalISel/legalize-fneg.mir
The file was modifiedllvm/test/CodeGen/ARM/GlobalISel/arm-legalize-binops.mir
Commit 140b7b6f09ca01f89701ccc86ddd8553cf42c311 by sam.mccall
[JSON] Allow emitting comments in json::OStream

This isn't standard JSON, but is a popular extension.
It will be used to show errors in context, rendering pseudo-json for humans.

Differential Revision: https://reviews.llvm.org/D88103
The file was modifiedllvm/lib/Support/JSON.cpp
The file was modifiedllvm/include/llvm/Support/JSON.h
The file was modifiedllvm/unittests/Support/JSONTest.cpp
Commit fa5f9452120cc1691d23e272697695a5a4331f9c by gkm
[lld-macho] cleanup unimplemented-option warnings

Remove all spurious `HelpHidden` flags from  `lld/MachO/Options.td`. Add test for `HelpHidden` to `warnIfUnimplementedOption()` so that the empty `// handled elsewhere` case is unnecessary.

Reviewed By: #lld-macho, int3, smeenai

Differential Revision: https://reviews.llvm.org/D88160
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/MachO/Options.td
Commit d9717d8ee7143f4f5b768dfb5e8629ecfa067e39 by craig.topper
[X86] Add a memory clobber to the bittest intrinsic inline asm. Get default clobbers from the target

I believe the inline asm emitted here should have a memory clobber since it writes to memory.

It was also missing the dirflag clobber that we use by default along with flags and fpsr. To avoid missing defaults in the future, get the default list from the target

Differential Revision: https://reviews.llvm.org/D88121
The file was modifiedclang/lib/CodeGen/CGBuiltin.cpp
The file was modifiedclang/test/CodeGen/bittest-intrin.c
Commit 8f2c31f22b974da2c0fbc5de0ce4dceffe8ed0b8 by gkm
[lld-macho] handle options -search_paths_first, -search_dylibs_first

Differential Revision: https://reviews.llvm.org/D88054
The file was modifiedlld/MachO/Options.td
The file was modifiedlld/MachO/Config.h
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/test/MachO/link-search-order.s
Commit 16619e7139bdcb0021598ba76cb5cf30ac669dbb by sam.mccall
[JSON] Facility to track position within an object and report errors.

This error model should be rich enough for most applications. It comprises:

- a name for the root object, so the user knows what we're parsing
- a path from the root object to the JSON node most associated with the error
- a local error message

This can be presented as an llvm::Error e.g.
  "expected string at ConfigFile.credentials[0].username"

It's designed to be cheap: Paths are a linked list of lightweight
objects on the stack. No heap allocations unless errors are encountered.

A subsequent commit will make use of this in the JSON-to-object
translation facilities: fromJSON and ObjectMapper.
However it's independent of these and can be used for e.g. validation alone.

Another subsequent commit will support showing the error in its context
within the parsed value.

Differential Revision: https://reviews.llvm.org/D88103
The file was modifiedllvm/lib/Support/JSON.cpp
The file was modifiedllvm/unittests/Support/JSONTest.cpp
The file was modifiedllvm/include/llvm/Support/JSON.h
Commit 6700b9de1637fd9888dfe9628157d2aeb6d9f526 by aeubanks
[NewPM][MSSA] Fix failures under NPM due to -enable-mssa-loop-dependency

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D88128
The file was modifiedllvm/test/Transforms/LICM/promote-order.ll
The file was modifiedllvm/test/Transforms/LICM/read-only-calls.ll
The file was modifiedllvm/test/Analysis/BasicAA/store-promote.ll
The file was modifiedllvm/test/Transforms/LICM/argmemonly-call.ll
The file was modifiedllvm/test/Transforms/LICM/atomics.ll
The file was modifiedllvm/test/Transforms/LICM/store-hoisting.ll
Commit 6b1ce83a1238815899cf18f69bbc0eb37679a410 by aeubanks
[NewPM][CGSCC] Handle newly added functions in updateCGAndAnalysisManagerForPass

This seems to fit the CGSCC updates model better than calling
addNewFunctionInto{Ref,}SCC() on newly created/outlined functions.
Now addNewFunctionInto{Ref,}SCC() are no longer necessary.

However, this doesn't work on newly outlined functions that aren't
referenced by the original function. e.g. if a() was outlined into b()
and c(), but c() is only referenced by b() and not by a(), this will
trigger an assert.

This also fixes an issue I was seeing with newly created functions not
having passes run on them.

Ran check-llvm with expensive checks.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D87798
The file was modifiedllvm/lib/Transforms/Utils/CallGraphUpdater.cpp
The file was modifiedllvm/lib/Analysis/CGSCCPassManager.cpp
The file was modifiedllvm/unittests/Analysis/CGSCCPassManagerTest.cpp
The file was modifiedllvm/unittests/Analysis/LazyCallGraphTest.cpp
The file was modifiedllvm/lib/Transforms/Coroutines/CoroSplit.cpp
The file was modifiedllvm/lib/Analysis/LazyCallGraph.cpp
The file was modifiedllvm/include/llvm/Analysis/LazyCallGraph.h
Commit 111aa4e36614d9a056cf5040d4d7bbfddeb9ebb2 by aeubanks
[NewPM] Add callbacks to PassBuilder to run before/after parsing a pass

This is in preparation for supporting -debugify-each, which adds a debug
info pass before and after each pass.

Switch VerifyEach to use this.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D88107
The file was modifiedllvm/include/llvm/Passes/PassBuilder.h
The file was modifiedpolly/lib/Support/RegisterPasses.cpp
The file was modifiedllvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
The file was modifiedllvm/tools/opt/NewPMDriver.cpp
The file was modifiedllvm/lib/Passes/PassBuilder.cpp
The file was modifiedllvm/unittests/IR/PassBuilderCallbacksTest.cpp
Commit 38de1c33a8374bb16abfb024a973d851c170bafc by sam.mccall
[JSON] Display errors associated with Paths in context

When an error occurs processing a JSON object, seeing the actual
surrounding data helps. Dumping just the node where the problem
was identified can be too much or too little information.

printErrorContext() shows the error message in its context, as a comment.
JSON values along the path to the broken place are shown in some detail,
the rest of the document is elided. For example:

```
{
  "credentials": [
    {
      "username": /* error: expected string */ 42,
      "password": "secret"
    },
    { ... }
  ]
  "backups": { ... }
}
```

Differential Revision: https://reviews.llvm.org/D88103
The file was modifiedllvm/include/llvm/Support/JSON.h
The file was modifiedllvm/unittests/Support/JSONTest.cpp
The file was modifiedllvm/lib/Support/JSON.cpp
Commit b16d6653c01cee37f51a98dd4092c4ef302c47a5 by rprichard
[libunwind] Combine dl_iterate_phdr codepaths for DWARF and EHABI

dl_iterate_phdr is used to search for unwind info provided by either
PT_GNU_EH_FRAME or PT_ARM_EXIDX. Most of the code between the two is
the same, so combine them, and factor out what's different into
checkForUnwindInfoSegment.

Details:
- The FrameHeaderCache can now be enabled for ARM EHABI.
- findUnwindSectionsByPhdr now finds the last PT_ARM_EXIDX rather than
   the first. There should only be one segment.
- The dso_base and text_segment_length fields of UnwindInfoSections
   are now needed for dl_iterate_phdr when using EHABI, to hold the
   low and high PC values for a cache entry.

Reviewed By: compnerd, danielkiss, #libunwind, saugustine

Differential Revision: https://reviews.llvm.org/D87880
The file was modifiedlibunwind/test/frameheadercache_test.pass.cpp
The file was modifiedlibunwind/src/AddressSpace.hpp
Commit 881aba7071c6e4cc2417e875ca5027ec7c0a92a3 by rprichard
[libunwind] Optimize dl_iterate_phdr's findUnwindSectionsByPhdr

Currently, findUnwindSectionsByPhdr is slightly micro-optimized for the
case where the first callback has the target address, and is otherwise
very inefficient -- it decodes .eh_frame_hdr even when no PT_LOAD
matches the PC. (If the FrameHeaderCache is enabled, then the
micro-optimization only helps the first time unwind info is looked up.)

Instead, it makes more sense to optimize for the case where the
callback *doesn't* find the target address, so search for a PT_LOAD
segment first, and only look for the unwind info section if a matching
PT_LOAD is found.

This change helps on an Android benchmark with 100 shared objects,
where the DSO at the end of the dl_iterate_phdr list throws 10000
exceptions. Assuming the frame cache is disabled, this change cuts
about 30-40% off the benchmark's runtime.

Reviewed By: compnerd, saugustine, #libunwind

Differential Revision: https://reviews.llvm.org/D87881
The file was modifiedlibunwind/src/AddressSpace.hpp
Commit fa69b608063eecba76fb35d167b063cbfe532c28 by sam.mccall
[JSON] Add error reporting to fromJSON and ObjectMapper

Translating between JSON objects and C++ strutctures is common.
From experience in clangd, fromJSON/ObjectMapper work well and save a lot of
code, but aren't adopted elsewhere at least partly due to total lack of error
reporting beyond "ok"/"bad".

The recently-added error model should be rich enough for most applications.
It requires tracking the path within the root object and reporting local
errors at appropriate places.
To do this, we exploit the fact that the call graph of recursive
parse functions mirror the structure of the JSON itself.
The current path is represented as a linked list of segments, each of which is
on the stack as a parameter. Concretely, fromJSON now looks like:
  bool fromJSON(const Value&, T&, Path);

Beyond the signature change, this is reasonably unobtrusive: building
the path segments is mostly handled by ObjectMapper and the vector<T> fromJSON.
However the root caller of fromJSON must now create a Root object to
store the errors, which is a little clunky.

I've added high-level parse<T>(StringRef) -> Expected<T>, but it's not
general enough to be the primary interface I think (at least, not usable in
clangd).

All existing users (mostly just clangd) are updated in this patch,
making this change backwards-compatible is a bit hairy.

Differential Revision: https://reviews.llvm.org/D88103
The file was modifiedclang-tools-extra/clangd/Protocol.h
The file was modifiedclang-tools-extra/clangd/Protocol.cpp
The file was modifiedclang-tools-extra/clangd/ClangdLSPServer.cpp
The file was modifiedclang-tools-extra/clangd/index/Index.h
The file was modifiedclang-tools-extra/clangd/index/Index.cpp
The file was modifiedlldb/source/Utility/StructuredData.cpp
The file was modifiedclang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp
The file was modifiedllvm/lib/Analysis/TFUtils.cpp
The file was modifiedllvm/include/llvm/Support/JSON.h
The file was modifiedllvm/unittests/Support/JSONTest.cpp
The file was modifiedclang-tools-extra/clangd/ClangdLSPServer.h
Commit 751f5c81468966d921ad54827d27ff19aa43af8e by sam.mccall
Fix LLDB tweak in 62a47e994fcf5b73e29547d26cd9676b30cb69a3
The file was modifiedlldb/source/Utility/StructuredData.cpp
Commit 23291e8ec7e8f54db56ff77b61313e9d55a23861 by Louis Dionne
[libc++] Fix spurious test failure in -fno-exceptions
The file was modifiedlibcxx/test/std/containers/sequences/vector/vector.modifiers/resize_not_move_insertable.fail.cpp
Commit 2bd5e3fb3cc032f90447067d38c48c75b23f32c5 by sam.mccall
[clangd] Improve bad-RPC-payload error messages slightly
The file was modifiedclang-tools-extra/clangd/ClangdLSPServer.h
Commit f5435399e823746bbe1737b95c853d77a42e1ac3 by zequanwu
[CGProfile] don't emit cgprofile entry if called function is dllimport

Differential Revision: https://reviews.llvm.org/D88127
The file was modifiedllvm/test/Instrumentation/cgprofile.ll
The file was modifiedllvm/lib/Transforms/Instrumentation/CGProfile.cpp
Commit ee7ee71f40e904a8380d6439ac4741304b4a2dfd by smeenai
Explicitly specify CMAKE_AR in WinMsvc.cmake

As of cmake 3.18, cmake changes how it searches for compilers for
Windows (see
https://gitlab.kitware.com/cmake/cmake/-/commit/55196a1440e26917d40e6a7a3eb8d9fb323fa657)
and now finds llvm-ar instead of llvm-lib as CMAKE_AR. This explicitly
specifies CMAKE_AR as llvm-lib so the correct program is found.

Reviewed By: smeenai

Differential Revision: https://reviews.llvm.org/D88176
The file was modifiedllvm/cmake/platforms/WinMsvc.cmake
The file was modifiedllvm/cmake/modules/LLVMExternalProjectUtils.cmake
Commit 92d42b32a9b7a085fd200a56022724a77cf12a2d by Saleem Abdulrasool
Utility: ignore OS version on non-Darwin targets in `ArchSpec`

The OS version field is generally not very helpful for non-Darwin
targets.  On Linux, it identifies the kernel version which moves
out-of-sync with the userspace.  On Windows, this field actually ends up
corresponding to the Visual Studio toolset version instead of the OS
version.  Consider non-Darwin targets without an OS version to be fully
specified.

Differential Revision: https://reviews.llvm.org/D88181
Reviewed By: Jonas Devlieghere, Dave Lee
The file was modifiedlldb/source/Utility/ArchSpec.cpp
Commit bc7f6c6dd8252370e6b485b8193093004644a16d by freddy.ye
[X86] Add TDX instructions.

For more details about these instructions, please refer to the latest TDX document: https://software.intel.com/content/www/us/en/develop/articles/intel-trust-domain-extensions.html

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D88006
The file was modifiedllvm/test/MC/X86/x86-64.s
The file was modifiedllvm/test/MC/Disassembler/X86/x86-64.txt
The file was modifiedllvm/test/MC/X86/x86-32-coverage.s
The file was modifiedllvm/lib/Target/X86/X86InstrInfo.td
The file was addedllvm/lib/Target/X86/X86InstrTDX.td
The file was modifiedllvm/test/MC/Disassembler/X86/x86-32.txt
Commit 3d38a975d72c8711a123d1862e517bcbdab7d700 by i
[X86] Parse data32 call in .code16 as CALLpcrel32

Used by kexec-tools (PR46942)
In GNU as, tc-i386.c:output_jump uses 4-byte immediate if a data32 prefix is present.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D88137
The file was modifiedllvm/test/MC/X86/x86-16.s
The file was modifiedllvm/test/MC/X86/data-prefix-fail.s
The file was modifiedllvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
Commit 29aaa188480e59f136330d77d255453e8d744b32 by aeubanks
Revert "[NewPM] Add callbacks to PassBuilder to run before/after parsing a pass"

This reverts commit 111aa4e36614d9a056cf5040d4d7bbfddeb9ebb2.
The file was modifiedpolly/lib/Support/RegisterPasses.cpp
The file was modifiedllvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
The file was modifiedllvm/include/llvm/Passes/PassBuilder.h
The file was modifiedllvm/unittests/IR/PassBuilderCallbacksTest.cpp
The file was modifiedllvm/lib/Passes/PassBuilder.cpp
The file was modifiedllvm/tools/opt/NewPMDriver.cpp
Commit 1e0500d4f7f19b3eae0f9b6f05591a40188d8d99 by carl.ritson
[AMDGPU] Consider all SGPR uses as unique in constant bus verify

Fix the verifier so that overlapping SGPR operands are counted
independently.  We cannot assume that overlapping SGPR accesses
only count as a single constant bus use.
The exception is implicit uses which do not add to constant bus
usage (only) when overlapping.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D87748
The file was addedllvm/test/CodeGen/AMDGPU/verify-constant-bus-violations.mir
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.cpp
Commit 714075f9c1ac50cde20e21e559f0e29fdc848bf1 by aeubanks
[NFC] Remove unnecessary default constructors
The file was modifiedllvm/include/llvm/Passes/StandardInstrumentations.h
Commit 41d6669f1f16cc2f6cd0faf2c58447d1aa2072fa by Pushpinder.Singh
[GlobalISel][AMDGPU] Lower G_SMULH/G_UMULH

Reviewed By: arsenm, foad

Differential Revision: https://reviews.llvm.org/D85653
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-smulh.mir
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/legalize-umulh.mir
Commit 63ace77962543f961f1d566dd1243b1fb37129ef by jezng
[lld-macho] Initial support for common symbols

On Unix, it is traditionally allowed to write variable definitions without
initialization expressions (such as "int foo;") to header files. These are
called tentative definitions.

The compiler creates common symbols when it sees tentative definitions. When
linking the final binary, if there are remaining common symbols after name
resolution is complete, the linker converts them to regular defined symbols in
a `__common` section.

This diff implements most of that functionality, though we do not yet handle
the case where there are both common and non-common definitions of the same
symbol.

Reviewed By: #lld-macho, gkm

Differential Revision: https://reviews.llvm.org/D86909
The file was modifiedlld/MachO/Symbols.h
The file was addedlld/test/MachO/common-symbol-coalescing.s
The file was modifiedlld/MachO/SymbolTable.h
The file was modifiedlld/MachO/SyntheticSections.h
The file was modifiedlld/MachO/InputFiles.cpp
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/MachO/SymbolTable.cpp
Commit cd7cb0c30305501982ba37b4905bb264b3539ad0 by jezng
[lld-macho] Implement and test resolution of common symbols

Handle the case where there are both common and non-common definitions
of the same symbol. Add a bunch of tests to ensure compatibility with ld64.

Reviewed By: #lld-macho, gkm

Differential Revision: https://reviews.llvm.org/D86910
The file was modifiedlld/test/MachO/nonweak-definition-override.s
The file was modifiedlld/MachO/SymbolTable.cpp
The file was addedlld/test/MachO/common-symbol-resolution.s
Commit 5d26bd3b75538515194d9e54c76e723524c1ac18 by jezng
[lld-macho] Emit indirect symbol table

Makes it a little easier to read objdump's disassembly.

Reviewed By: #lld-macho, gkm

Differential Revision: https://reviews.llvm.org/D87178
The file was addedlld/test/MachO/indirect-symtab.s
The file was modifiedlld/MachO/Symbols.h
The file was modifiedlld/MachO/Writer.cpp
The file was modifiedlld/MachO/OutputSection.h
The file was modifiedlld/MachO/SyntheticSections.h
The file was modifiedlld/MachO/SyntheticSections.cpp
Commit 79412d6ca772c1c3913030cfef4b17f4afac110d by jezng
[lld-macho] Ignore `-mllvm` and its argument

Test Plan:

Reviewed By: #lld-macho, compnerd, MaskRay

Differential Revision: https://reviews.llvm.org/D87803
The file was modifiedlld/test/MachO/silent-ignore.test
The file was modifiedlld/MachO/Options.td
Commit 98f03908d07d06c74be5547cc0436bd89186cae2 by jezng
[lld-macho] Support -weak_lx, -weak_library, -weak_framework

They cause their corresponding libraries / frameworks to be loaded via
`LC_LOAD_WEAK_DYLIB` instead of `LC_LOAD_DYLIB`.

Reviewed By: #lld-macho, gkm

Differential Revision: https://reviews.llvm.org/D87929
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/MachO/InputFiles.h
The file was modifiedlld/MachO/Options.td
The file was modifiedlld/MachO/Writer.cpp
The file was addedlld/test/MachO/weak-import.s
Commit ca8752a793f1576b666fb22a74278d44725138f1 by jezng
[lld-macho][NFC] Refactor syslibroot / library path lookup

* Move computation of systemLibraryRoots into a separate function, so we
  can add more functionality to it without things becoming unwieldy
* Have `getSearchPaths` and related functions return by value instead of
  by output parameter. NRVO should ensure that performance is unaffected.

Reviewed By: #lld-macho, smeenai

Differential Revision: https://reviews.llvm.org/D87959
The file was modifiedlld/MachO/Driver.cpp