Changes

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

Summary

  1. [lld/mac] Delete incorrect FIXME (details)
  2. [libc] Calculate ulp error after rounding MPFR result to the result type. (details)
  3. [NFC][compiler-rt] Remove iOS xfail for unpoison-alternate-stack (details)
  4. [lldb] Decouple ObjCLanguage from Symtab (details)
  5. [NFC][AArch64] Autogenerate assembly checklines in arm64-instruction-mix-remarks.ll (details)
  6. [PatternMatch] Make m_VScale compatible with opaque pointers (details)
  7. Replace python3 with %python in ML inlining tests. (details)
  8. [SjLj] Insert UnregisterFn before musttail call (details)
  9. [libc++abi][AIX] Enable calculating addresses with DW_EH_PE_datarel (details)
  10. [MCA][TimelineView] Fixed a bug that was causing instructions outside of the timeline-max-cycles to still be printed. (details)
  11. mailmap: add mappings for myself (details)
  12. Revert "[SjLj] Insert UnregisterFn before musttail call" (details)
  13. [SjLj] Insert UnregisterFn before musttail call (details)
  14. [CGP][RISCV] Teach CodeGenPrepare::optimizeSwitchInst to honor isSExtCheaperThanZExt. (details)
  15. [llvm-diff] Explicitly check ConstantStructs for differences (details)
  16. [LangRef] add note to warn-frame-size about ODR (details)
  17. [NFC] [DwarfEHPrepare] Add additional stats for EH (details)
  18. [Clang] Check for returns_nonnull when deciding to add allocation null checks (details)
  19. [AIX] Emitting diagnostics error for profile options (details)
  20. [LVI] Remove recursion from getValueForCondition (NFCI) (details)
  21. Implement an scf.for range folding optimization pass. (details)
  22. Revert "[AMDGPU] [IndirectCalls] Don't propagate attributes to address taken functions and their callees" (details)
  23. [hwasan] Respect llvm.asan.globals. (details)
  24. AST: Create __va_list in the std namespace even in C. (details)
  25. Revert "ThinLTO: Fix inline assembly references to static functions with CFI" (details)
  26. gn build: Build ubsan_minimal on Android. (details)
  27. [docs][NewPM] Add some instructions on how to invoke opt (details)
  28. [PowerPC] Add test to show passes in O3 pipeline. NFC. (details)
  29. [HIP] Defer operator overloading errors (details)
  30. [ValueTypes] Define MVTs for v3i64/v3f64 to complement v6i32/v6f32 (details)
  31. [AMDGPU] Add 224-bit vector types and link 192-bit types to MVTs (details)
  32. [lld-macho] add tests for ICF, plus cleanups (details)
  33. [trace] Add a TraceCursor class (details)
  34. [scudo] Enabled MTE before the first allocator (details)
  35. [NFC][trace] remove dead function (details)
  36. [scudo] Fix use of ScopedDisableMemoryTagChecks in test (details)
  37. [scudo] Avoid ifdef in test (details)
  38. [scudo] Fix test on arch without MTE (details)
  39. tsan: fix mmap atomicity (details)
  40. tsan: re-enable mmap_stress.cpp test (details)
Commit ef75358080a28501eccc552a3fa8214ceb3f34dc by thakis
[lld/mac] Delete incorrect FIXME

"""Bitcode symbols only exist before LTO runs, and only serve the purpose of
resolving visibility so LTO can better optimize. Running LTO creates ObjFiles
from BitcodeFiles, and those ObjFiles contain regular Defined symbols (with
isec set and all) that will replace the bitcode symbols. So things should
(hopefully) work as-is :)"""

  -- https://reviews.llvm.org/rGdbbc8d8333f29cf4ad6f4793da1adf71bbfdac69#inline-6081
The file was modifiedlld/MachO/UnwindInfoSection.cpp
Commit d5700bb694490b7e2a3c5dbd29d2a82b0843c8e9 by sivachandra
[libc] Calculate ulp error after rounding MPFR result to the result type.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D104615
The file was modifiedlibc/utils/MPFRWrapper/MPFRUtils.cpp
Commit 05e48eccdd69fd974010f3a32c56e909d46230d8 by code
[NFC][compiler-rt] Remove iOS xfail for unpoison-alternate-stack

This test was originally xfailed because of a bug on iOS. This has since been fixed, so reenabling the test.
The file was modifiedcompiler-rt/test/asan/TestCases/Posix/unpoison-alternate-stack.cpp
Commit 5bebc0b177d0f02af3d8d2b02d182c04763ee468 by apl
[lldb] Decouple ObjCLanguage from Symtab

We can extend/modify `GetMethodNameVariants` to suit our purposes here.
What symtab is looking for is alternate names we may want to use to
search for a specific symbol, and asking for variants of a name makes
the most sense here.

Differential Revision: https://reviews.llvm.org/D104067
The file was modifiedlldb/include/lldb/Target/Language.h
The file was modifiedlldb/source/Symbol/CMakeLists.txt
The file was modifiedlldb/source/Symbol/Symtab.cpp
The file was modifiedlldb/source/Breakpoint/BreakpointResolverName.cpp
The file was modifiedlldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
The file was modifiedlldb/source/Plugins/Language/ObjC/ObjCLanguage.h
Commit e6a353061fe9d7b2d4a7d0941709faec4d4d63d3 by lebedev.ri
[NFC][AArch64] Autogenerate assembly checklines in arm64-instruction-mix-remarks.ll
The file was modifiedllvm/test/CodeGen/AArch64/arm64-instruction-mix-remarks.ll
Commit 70b1a8c095b2498ea05ba12d248513db19dce92e by nikita.ppv
[PatternMatch] Make m_VScale compatible with opaque pointers

Use GEP source type instead of pointer element type.
The file was modifiedllvm/test/CodeGen/AArch64/sve-vscale.ll
The file was modifiedllvm/include/llvm/IR/PatternMatch.h
Commit 7c8a507272587f181ec29401453949ebcd8fec65 by jacobhegna
Replace python3 with %python in ML inlining tests.

Differential Revision: https://reviews.llvm.org/D104818
The file was modifiedllvm/test/Transforms/Inline/ML/development-training-log.ll
The file was modifiedllvm/test/Transforms/Inline/ML/ml-test-development-mode.ll
The file was modifiedllvm/test/Transforms/Inline/ML/bounds-checks-rewards.ll
Commit f36703ada3dc18388ef5cdcbb8f39f74c27ad8e9 by lxfind
[SjLj] Insert UnregisterFn before musttail call

When inserting UnregisterFn, if there is a musttail call, we must insert before the call so that we don't break the musttail call contract.

Differential Revision: https://reviews.llvm.org/D104807
The file was modifiedllvm/lib/CodeGen/SjLjEHPrepare.cpp
The file was addedllvm/test/CodeGen/X86/sjlj-eh-musttail.ll
Commit afd3607c8f369a4f1989387cb1eed35976968c89 by xingxue
[libc++abi][AIX] Enable calculating addresses with DW_EH_PE_datarel

Summary:
This patch enables calculating relative addresses with the DW_EH_PE_datarel encoding using a 'base' for AIX. After setting registers for jumping to the user code in gxx_personality_v0(), 'base' is cached in exception_header member catchTemp for use in __cxa_call_unexpected if ttypeIndex is less than 0 (exception spec).

Reviewed by: MaskRay, sfertile, compnerd, libc++abi

Differential Revision: https://reviews.llvm.org/D101298
The file was modifiedlibcxxabi/src/cxa_personality.cpp
Commit 70040de32d73683938abef72515b736c5b6e68dc by patrickeholland
[MCA][TimelineView] Fixed a bug that was causing instructions outside of the timeline-max-cycles to still be printed.

Differential Revision: https://reviews.llvm.org/D104815
The file was modifiedllvm/tools/llvm-mca/Views/TimelineView.cpp
Commit f38f81127c83567095ca3acc74ed8291a41e7075 by Saleem Abdulrasool
mailmap: add mappings for myself

Add aliases for various alternative email addresses.
The file was modified.mailmap
Commit f8c84da23bc93e66f7a161e09a470b85b557740e by lxfind
Revert "[SjLj] Insert UnregisterFn before musttail call"

This reverts commit f36703ada3dc18388ef5cdcbb8f39f74c27ad8e9.
Test failure: https://lab.llvm.org/buildbot#builders/104/builds/3450
The file was removedllvm/test/CodeGen/X86/sjlj-eh-musttail.ll
The file was modifiedllvm/lib/CodeGen/SjLjEHPrepare.cpp
Commit f09ec01f1fbbf8920db65a77791d511bf4d03d3c by lxfind
[SjLj] Insert UnregisterFn before musttail call

When inserting UnregisterFn, if there is a musttail call, we must insert before the call so that we don't break the musttail call contract.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D104807
The file was modifiedllvm/lib/CodeGen/SjLjEHPrepare.cpp
The file was addedllvm/test/CodeGen/X86/sjlj-eh-musttail.ll
Commit 91319534ba00910fc8027dc4be3eeea4c321621d by craig.topper
[CGP][RISCV] Teach CodeGenPrepare::optimizeSwitchInst to honor isSExtCheaperThanZExt.

This optimization pre-promotes the input and constants for a
switch instruction to a legal type so that all the generated compares
share the same extend. Since RISCV prefers sext for i32 to i64
extends, we should honor that to use sext.w instead of a pair
of shifts.

Reviewed By: jrtc27

Differential Revision: https://reviews.llvm.org/D104612
The file was modifiedllvm/lib/CodeGen/CodeGenPrepare.cpp
The file was modifiedllvm/test/CodeGen/RISCV/jumptable.ll
Commit 826947080b7e884c4758eff6e6646f7df4cc5380 by isanbard
[llvm-diff] Explicitly check ConstantStructs for differences

A ConstantStruct is renamed when the LLVM context sees a new one. This
makes global variable initializers appear different when they aren't.
Instead, check the ConstantStruct for equivalence.

Differential Revision: https://reviews.llvm.org/D104734
The file was modifiedllvm/test/tools/llvm-diff/initializers.ll
The file was modifiedllvm/tools/llvm-diff/DifferenceEngine.cpp
Commit 24d48d45cc302a6abeab139d87ba87f7a2335323 by ndesaulniers
[LangRef] add note to warn-frame-size about ODR

As sugguested by @dblaikie in D104342.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D104736
The file was modifiedllvm/docs/LangRef.rst
Commit a7b62699c8dcdcf14bac9560eb970da4296ce993 by modimo
[NFC] [DwarfEHPrepare] Add additional stats for EH

Stats added:

1. NumCleanupLandingPadsUnreachable: how many cleanup landing pads were optimized as unreachable
1. NumCleanupLandingPadsRemaining: how many cleanup landing pads remain
1. NumNoUnwind: Number of functions with nounwind attribute
1. NumUnwind: Number of functions with unwind attribute

DwarfEHPrepare is always run a single time as part of `TargetPassConfig::addISelPasses()` which makes it an ideal place near the end of the pipeline to record this information.

Example output from clang built with exceptions cumulative during thinLTO backend (NumCleanupLandingPadsUnreachable was not incremented):

"dwarfehprepare.NumCleanupLandingPadsRemaining": 123660,
"dwarfehprepare.NumNoUnwind": 323836,
"dwarfehprepare.NumUnwind": 472893,

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D104161
The file was modifiedllvm/lib/CodeGen/DwarfEHPrepare.cpp
Commit 42b99e094c4f57b52807c56641c0a545b4a9a600 by modimo
[Clang] Check for returns_nonnull when deciding to add allocation null checks

Non-throwing allocators currently will always get null-check code. However, if the non-throwing allocator is explicitly annotated with returns_nonnull the null check should be elided.

Testing:
ninja check-all
added test case correctly elides

Reviewed By: bruno

Differential Revision: https://reviews.llvm.org/D102820
The file was modifiedclang/lib/AST/ExprCXX.cpp
The file was modifiedclang/test/CodeGenCXX/new.cpp
Commit ab244db1fa0b72f3c0ac928158569fdcc6db0236 by whitneyt
[AIX] Emitting diagnostics error for profile options

Only LLVM-based instrumentation profile is supported on AIX.
And it currently must be used with full LTO.

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D104803
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was modifiedclang/test/Driver/unsupported-option.c
Commit ae266e743c9182ebd9702ccea2afb16f470013db by carl.ritson
[LVI] Remove recursion from getValueForCondition (NFCI)

Convert getValueForCondition to a worklist model instead of using
recursion.

In pathological cases getValueForCondition recurses heavily.
Stack frames are quite expensive on x86-64, and some operating
systems (e.g. Windows) have relatively low stack size limits.
Using a worklist avoids potential failures from stack overflow.

Differential Revision: https://reviews.llvm.org/D104191
The file was modifiedllvm/lib/Analysis/LazyValueInfo.cpp
Commit 3f429e82d3ea1710ee0a841675acba9bb7b658d2 by joker.eph
Implement an scf.for range folding optimization pass.

In cases where arithmetic (addi/muli) ops are performed on an scf.for loops induction variable with a single use, we can fold those ops directly into the scf.for loop.

For example, in the following code:

```
scf.for %i = %c0 to %arg1 step %c1 {
  %0 = addi %arg2, %i : index
  %1 = muli %0, %c4 : index
  %2 = memref.load %arg0[%1] : memref<?xi32>
  %3 = muli %2, %2 : i32
  memref.store %3, %arg0[%1] : memref<?xi32>
}
```

we can lift `%0` up into the scf.for loop range, as it is the only user of %i:

```
%lb = addi %arg2, %c0 : index
%ub = addi %arg2, %i : index
scf.for %i = %lb to %ub step %c1 {
  %1 = muli %0, %c4 : index
  %2 = memref.load %arg0[%1] : memref<?xi32>
  %3 = muli %2, %2 : i32
  memref.store %3, %arg0[%1] : memref<?xi32>
}
```

Reviewed By: mehdi_amini, ftynse, Anthony

Differential Revision: https://reviews.llvm.org/D104289
The file was modifiedmlir/lib/Dialect/SCF/Transforms/CMakeLists.txt
The file was addedmlir/lib/Dialect/SCF/Transforms/LoopRangeFolding.cpp
The file was modifiedmlir/include/mlir/Dialect/SCF/Passes.h
The file was modifiedmlir/include/mlir/Dialect/SCF/Passes.td
The file was addedmlir/test/Dialect/SCF/loop-range.mlir
Commit 660cae84c3144a42272daa16415fc9a2532773c4 by jonathanchesterfield
Revert "[AMDGPU] [IndirectCalls] Don't propagate attributes to address taken functions and their callees"

This reverts commit 6a3beb1f68d6791a4cd0190f68b48510f754a00a.
Test case that triggers an infinite loop before the revert is at
the review for D103138.
The file was removedllvm/test/CodeGen/AMDGPU/propagate-attributes-launch-bounds.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUPropagateAttributes.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/propagate-attributes-function-pointer-argument.ll
The file was removedllvm/test/CodeGen/AMDGPU/propagate-attributes-direct-indirect-common-callee.ll
The file was removedllvm/test/CodeGen/AMDGPU/propagate-attributes-common-callees.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/opt-pipeline.ll
The file was removedllvm/test/CodeGen/AMDGPU/propagate-attributes-indirect.ll
Commit 78f7e6d8d7956cb96d0fa0fd606192ca0218eee1 by eugenis
[hwasan] Respect llvm.asan.globals.

This enable no_sanitize C++ attribute to exclude globals from hwasan
testing, and automatically excludes other sanitizers' globals (such as
ubsan location descriptors).

Differential Revision: https://reviews.llvm.org/D104825
The file was modifiedllvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
The file was modifiedllvm/test/Instrumentation/HWAddressSanitizer/globals.ll
Commit e655e74a318e0b4140391ae18725300c7f0629f6 by peter
AST: Create __va_list in the std namespace even in C.

This ensures that the mangled type names match between C and C++,
which is significant when using -fsanitize=cfi-icall. Ideally we
wouldn't have created this namespace at all, but it's now part of
the ABI (e.g. in mangled names), so we can't change it.

Differential Revision: https://reviews.llvm.org/D104830
The file was addedclang/test/CodeGen/cfi-icall-va-list.c
The file was modifiedclang/lib/AST/ASTContext.cpp
The file was modifiedclang/test/CodeGen/arm64-be-hfa-vararg.c
The file was modifiedclang/test/Headers/stdarg.cpp
The file was modifiedclang/test/CodeGen/aarch64-varargs.c
Commit 9393894331e9eba97bdafe92454af74550baf6d3 by zequanwu
Revert "ThinLTO: Fix inline assembly references to static functions with CFI"

This casues compiler crash: Assertion `materialized_use_empty() && "Uses remain when a value is destroyed!"'

This reverts commit e3d24b45b8f808ec66213e134c4ceda5202fbe31.
The file was modifiedllvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
The file was removedllvm/test/Transforms/ThinLTOBitcodeWriter/cfi-icall-static-inline-asm.ll
Commit 272af9c700b462a0cc00e3ff7809ac2c199cabfe by peter
gn build: Build ubsan_minimal on Android.
The file was modifiedllvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn
Commit e15673df279774fc11de0818577ec96857aa0f74 by aeubanks
[docs][NewPM] Add some instructions on how to invoke opt

Also add link to blog post.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D104812
The file was modifiedllvm/docs/NewPassManager.rst
Commit 767e200b43562d2a4af01c1f3de25fd3c9c2097d by lkail
[PowerPC] Add test to show passes in O3 pipeline. NFC.
The file was addedllvm/test/CodeGen/PowerPC/O3-pipeline.ll
Commit 82e03e494f9884e03b1ab4dfd3b55e6aa2161ade by Yaxun.Liu
[HIP] Defer operator overloading errors

Although clang is able to defer overloading resolution
diagnostics for common functions. It does not defer
overloading resolution caused diagnostics for overloaded
operators.

This patch extends the existing deferred
diagnostic mechanism and defers a diagnostic caused
by overloaded operator.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D104505
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/lib/Sema/SemaOverload.cpp
The file was modifiedclang/test/SemaCUDA/deferred-oeverload.cu
The file was modifiedclang/lib/Sema/Sema.cpp
The file was modifiedclang/include/clang/Sema/Overload.h
The file was modifiedclang/include/clang/Sema/Sema.h
Commit 6b0f98d442e0cf2b6e3a20ba518abb5549aa4999 by carl.ritson
[ValueTypes] Define MVTs for v3i64/v3f64 to complement v6i32/v6f32

Having type symmetry with these is somewhat necessary when implementing support for 192-bit values.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D104621
The file was modifiedllvm/lib/CodeGen/ValueTypes.cpp
The file was modifiedllvm/include/llvm/CodeGen/ValueTypes.td
The file was modifiedllvm/utils/TableGen/CodeGenTarget.cpp
The file was modifiedllvm/include/llvm/Support/MachineValueType.h
Commit 98f48723f2ca286d6f12bb0c4dc7830a55e85637 by carl.ritson
[AMDGPU] Add 224-bit vector types and link 192-bit types to MVTs

Add SReg_224, VReg_224, AReg_224, etc.
Link 224-bit types with v7i32/v7f32.
Link existing 192-bit types to newly added v3i64/v3f64/v6i32/v6f32.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D104622
The file was modifiedllvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/load-constant-i64.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/hsa-metadata-kernel-code-props.ll
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/load-global-i64.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/srem64.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/insert_vector_elt.v2i16.ll
The file was modifiedllvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
The file was modifiedllvm/lib/Target/AMDGPU/SIInstructions.td
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
The file was modifiedllvm/lib/Target/AMDGPU/SIRegisterInfo.td
The file was modifiedllvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/insertelement.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/vector_shuffle.packed.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/cvt_f32_ubyte.ll
The file was modifiedllvm/lib/Target/AMDGPU/SIISelLowering.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/insert_vector_elt.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/function-returns.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/load-global-f64.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/ipra-regmask.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPURegisterBanks.td
The file was modifiedllvm/test/CodeGen/AMDGPU/load-local-redundant-copies.ll
The file was modifiedllvm/lib/Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/code-object-v3.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/hsa-metadata-kernel-code-props-v3.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/sdiv64.ll
Commit 8a8558ae27955174c6a1948874b1f0f33e9e8b14 by gkm
[lld-macho] add tests for ICF, plus cleanups

Add tests for pending TODOs, plus some global cleanups:
* No fold: func has personality/LSDA
* Fold: reference to absolute symbol with different name but identical value
* No fold: reloc references to absolute symbols with different values
* No fold: N_ALT_ENTRY symbols

Differential Revision: https://reviews.llvm.org/D104721
The file was modifiedlld/test/MachO/icf.s
The file was modifiedlld/MachO/ICF.cpp
Commit 2aa1dd1c66dc3b1f6253eec9fc68c081a945b74d by walter erquinigo
[trace] Add a TraceCursor class

As a follow up of D103588, I'm reinitiating the discussion with a new proposal for traversing instructions in a trace which uses the feedback gotten in that diff.

See the embedded documentation in TraceCursor for more information. The idea is to offer an OOP way to traverse instructions exposing a minimal interface that makes no assumptions on:

- the number of instructions in the trace (i.e. having indices for instructions might be impractical for gigantic intel-pt traces, as it would require to decode the entire trace). This renders the use of indices to point to instructions impractical. Traces are big and expensive, and the consumer should try to do look linear lookups (forwards and/or backwards) and avoid random accesses (the API could be extended though, but for now I want to dicard that funcionality and leave the API extensible if needed).
- the way the instructions are represented internally by each Trace plug-in. They could be mmap'ed from a file, exist in plain vector or generated on the fly as the user requests the data.
- the actual data structure used internally for each plug-in. Ideas like having a struct TraceInstruction have been discarded because that would make the plug-in follow a certain data type, which might be costly. Instead, the user can ask the cursor for each independent property of the instruction it's pointing at.

The way to get a cursor is to ask Trace.h for the end or being cursor or a thread's trace.

There are some benefits of this approach:
- there's little cost to create a cursor, and this allows for lazily decoding a trace as the user requests data.
- each trace plug-in could decide how to cache the instructions it generates. For example, if a trace is small, it might decide to keep everything in memory, or if the trace is massive, it might decide to keep around the last thousands of instructions to speed up local searches.
- a cursor can outlive a stop point, which makes trace comparison for live processes feasible. An application of this is to compare profiling data of two runs of the same function, which should be doable with intel pt.

Differential Revision: https://reviews.llvm.org/D104422
The file was modifiedlldb/source/Target/Trace.cpp
The file was modifiedlldb/include/lldb/lldb-forward.h
The file was modifiedlldb/include/lldb/Target/Trace.h
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
The file was addedlldb/include/lldb/Target/TraceCursor.h
The file was modifiedlldb/include/lldb/lldb-enumerations.h
The file was addedlldb/source/Target/TraceCursor.cpp
The file was modifiedlldb/include/lldb/lldb-defines.h
The file was modifiedlldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp
The file was modifiedlldb/source/Target/CMakeLists.txt
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
Commit 533abb7ecf1c0e80429ad7cd850e9720d2b2ae1c by Vitaly Buka
[scudo] Enabled MTE before the first allocator

Reviewed By: pcc

Differential Revision: https://reviews.llvm.org/D103726
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/scudo_unit_test_main.cpp
The file was modifiedcompiler-rt/lib/scudo/standalone/allocator_config.h
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/wrappers_cpp_test.cpp
Commit f0d06124769f477a26f8fa2589f0ace85419c120 by walter erquinigo
[NFC][trace] remove dead function

The Trace::GetCursorPosition function was never really implemented well and it's being replaced by a more correct TraceCursor object.
The file was modifiedlldb/test/API/commands/trace/TestTraceStartStop.py
The file was modifiedlldb/include/lldb/Target/Trace.h
The file was modifiedlldb/test/API/commands/trace/multiple-threads/TestTraceStartStopMultipleThreads.py
The file was modifiedlldb/source/Commands/CommandObjectThread.cpp
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
Commit 99ec78c0feded25a2b01dd5ae822b37a70b63c17 by Vitaly Buka
[scudo] Fix use of ScopedDisableMemoryTagChecks in test
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/wrappers_cpp_test.cpp
Commit 6fd963ab64e7f0771bd59056b71ce915bc03d951 by Vitaly Buka
[scudo] Avoid ifdef in test
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/wrappers_cpp_test.cpp
Commit 35e1dbd18920a0f1863cd06651d217693a94ad60 by Vitaly Buka
[scudo] Fix test on arch without MTE
The file was modifiedcompiler-rt/lib/scudo/standalone/tests/wrappers_cpp_test.cpp
Commit 1db68fcd8e76dc6437f028c8ace408aa7d04e647 by dvyukov
tsan: fix mmap atomicity

Mmap interceptor is not atomic in the sense that it
exposes unmapped shadow for a brief period of time.
This breaks programs that mmap over another mmap
and access the region concurrently.
Don't unmap shadow in the mmap interceptor to fix this.
Just mapping new shadow on top should be enough to zero it.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D104593
The file was modifiedcompiler-rt/lib/tsan/rtl/tsan_rtl.cpp
The file was addedcompiler-rt/test/tsan/mmap_stress2.cpp
Commit 2f6f24f0107c2f541297a4a0b365d862142d75e5 by dvyukov
tsan: re-enable mmap_stress.cpp test

The comment says it was flaky in 2016,
but it wasn't possible to debug it back then.
Re-enable the test at least on linux/x86_64.
It will either work, or at least we should
see failure output from lit today.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D104592
The file was modifiedcompiler-rt/test/tsan/mmap_stress.cpp