SuccessChanges

Summary

  1. [TargetList] Delete the destructor (details)
  2. [CodeExtractor] Replace uses of extracted bitcasts in out-of-region lifetime markers (details)
  3. [lldb] Remove Crashlog/interactive.test (details)
  4. Revert "Allow searching for prebuilt implicit modules." (details)
  5. [X86] check the k pair register in ipra-reg-usage.ll. (details)
  6. [VE][NFC] Update rem.ll regression test (details)
  7. [trace][intel-pt] Implement the basic decoding functionality (details)
  8. [flang][openacc] Add parsing tests and semantic check for set directive (details)
Commit 65d15fefe3392b1db2f679b3df029d43d8d26d2d by Vedant Kumar
[TargetList] Delete the destructor

AFAICT, ~TargetList simply implements the default destructor, plus some
locking.

The history is murky, so I'm not sure why we do this locking. Perhaps,
at some point, it was possible to delete the same TargetList instance
from two different threads, setting up a race. If that were true, then
the locking would protect against the race.

Since TargetList is uniquely owned by Debugger (m_target_list), no such
race is possible today.

Testing: check-lldb

Differential Revision: https://reviews.llvm.org/D90895
The file was modifiedlldb/source/Target/TargetList.cpp
The file was modifiedlldb/include/lldb/Target/TargetList.h
Commit 700d2417d8281ea56dfd7ac72d1a1473d03d2d59 by georgakoudis1
[CodeExtractor] Replace uses of extracted bitcasts in out-of-region lifetime markers

CodeExtractor handles bitcasts in the extracted region that have
lifetime markers users in the outer region as outputs. That
creates unnecessary alloca/reload instructions and extra lifetime
markers. The patch identifies those cases, and replaces uses in
out-of-region lifetime markers with new bitcasts in the outer region.

**Example**
```
define void @foo() {
entry:
  %0 = alloca i32
  br label %extract

extract:
  %1 = bitcast i32* %0 to i8*
  call void @llvm.lifetime.start.p0i8(i64 4, i8* %1)
  call void @use(i32* %0)
  br label %exit

exit:
  call void @use(i32* %0)
  call void @llvm.lifetime.end.p0i8(i64 4, i8* %1)
  ret void
}
```

**Current extraction**
```
define void @foo() {
entry:
  %.loc = alloca i8*, align 8
  %0 = alloca i32, align 4
  br label %codeRepl

codeRepl:                                         ; preds = %entry
  %lt.cast = bitcast i8** %.loc to i8*
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* %lt.cast)
  %lt.cast1 = bitcast i32* %0 to i8*
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* %lt.cast1)
  call void @foo.extract(i32* %0, i8** %.loc)
  %.reload = load i8*, i8** %.loc, align 8
  call void @llvm.lifetime.end.p0i8(i64 -1, i8* %lt.cast)
  br label %exit

exit:                                             ; preds = %codeRepl
  call void @use(i32* %0)
  call void @llvm.lifetime.end.p0i8(i64 4, i8* %.reload)
  ret void
}

define internal void @foo.extract(i32* %0, i8** %.out) {
newFuncRoot:
  br label %extract

exit.exitStub:                                    ; preds = %extract
  ret void

extract:                                          ; preds = %newFuncRoot
  %1 = bitcast i32* %0 to i8*
  store i8* %1, i8** %.out, align 8
  call void @use(i32* %0)
  br label %exit.exitStub
}
```

**Extraction with patch**
```
define void @foo() {
entry:
  %0 = alloca i32, align 4
  br label %codeRepl

codeRepl:                                         ; preds = %entry
  %lt.cast1 = bitcast i32* %0 to i8*
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* %lt.cast1)
  call void @foo.extract(i32* %0)
  br label %exit

exit:                                             ; preds = %codeRepl
  call void @use(i32* %0)
  %lt.cast = bitcast i32* %0 to i8*
  call void @llvm.lifetime.end.p0i8(i64 4, i8* %lt.cast)
  ret void
}

define internal void @foo.extract(i32* %0) {
newFuncRoot:
  br label %extract

exit.exitStub:                                    ; preds = %extract
  ret void

extract:                                          ; preds = %newFuncRoot
  %1 = bitcast i32* %0 to i8*
  call void @use(i32* %0)
  br label %exit.exitStub
}
```

Reviewed By: vsk

Differential Revision: https://reviews.llvm.org/D90689
The file was modifiedllvm/unittests/Transforms/Utils/CodeExtractorTest.cpp
The file was modifiedllvm/lib/Transforms/Utils/CodeExtractor.cpp
Commit 99a99c29c6daef56a320a0d77bb6691aa66d81f1 by Jonas Devlieghere
[lldb] Remove Crashlog/interactive.test

This test requires running under the Python we built against (which is
easy) and setting up the PYTHONPATH (which is not worth it for this
simple test).
The file was removedlldb/test/Shell/ScriptInterpreter/Python/Crashlog/interactive.test
Commit c67656b994c87224e0b33e2c4b09093986a5cfa6 by stilis
Revert "Allow searching for prebuilt implicit modules."

This reverts commit 71e108cd86e70b06c5fa3a63689dcb3555c3d13f.

This change caused a build failure on Windows:
http://lab.llvm.org:8011/#/builders/83/builds/570
The file was modifiedclang/include/clang/Lex/HeaderSearchOptions.h
The file was modifiedclang/include/clang/Lex/HeaderSearch.h
The file was modifiedclang/lib/Serialization/ASTReader.cpp
The file was removedclang/test/Modules/Inputs/prebuilt-implicit-module/a.h
The file was modifiedclang/lib/Serialization/ASTWriter.cpp
The file was modifiedclang/include/clang/Frontend/CompilerInstance.h
The file was modifiedclang/lib/Lex/HeaderSearch.cpp
The file was modifiedclang/docs/Modules.rst
The file was removedclang/test/Modules/Inputs/prebuilt-implicit-module/module.modulemap
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
The file was removedclang/test/Modules/prebuilt-implicit-modules.m
The file was modifiedclang/lib/Frontend/CompilerInstance.cpp
The file was modifiedclang/lib/Frontend/CompilerInvocation.cpp
Commit 6ca8569f096cf94520cb2dd329cd08fbe8392d58 by yuanke.luo
[X86] check the k pair register in ipra-reg-usage.ll.

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D90810
The file was modifiedllvm/test/CodeGen/X86/ipra-reg-usage.ll
Commit b8745751f167f16717d36867ca46328afa4b7919 by marukawa
[VE][NFC] Update rem.ll regression test

`Replace ISD::SREM handling with KnownBits::srem to reduce code
duplication` (bf04e34383b06f1b71819de7f34a1a1de2cdb6a4) changed
the result of rem.ll regression test.  So, updating it.
The file was modifiedllvm/test/CodeGen/VE/Scalar/rem.ll
Commit cfd96f057ba4256fef49518cad43d0a7f591da12 by a20012251
[trace][intel-pt] Implement the basic decoding functionality

Depends on D89408.

This diff finally implements trace decoding!

The current interface is

  $ trace load /path/to/trace/session/file.json
  $ thread trace dump instructions

  thread #1: tid = 3842849, total instructions = 22
    [ 0] 0x40052d
    [ 1] 0x40052d
    ...
    [19] 0x400521

  $ # simply enter, which is a repeat command
    [20] 0x40052d
    [21] 0x400529
    ...

This doesn't do any disassembly, which will be done in the next diff.

Changes:
- Added an IntelPTDecoder class, that is a wrapper for libipt, which is the actual library that performs the decoding.
- Added TraceThreadDecoder class that decodes traces and memoizes the result to avoid repeating the decoding step.
- Added a DecodedThread class, which represents the output from decoding and that for the time being only stores the list of reconstructed instructions. Later it'll contain the function call hierarchy, which will enable reconstructing backtraces.
- Added basic APIs for accessing the trace in Trace.h:
  - GetInstructionCount, which counts the number of instructions traced for a given thread
  - IsTraceFailed, which returns an Error if decoding a thread failed
  - ForEachInstruction, which iterates on the instructions traced for a given thread, concealing the internal storage of threads, as plug-ins can decide to generate the instructions on the fly or to store them all in a vector, like I do.
- DumpTraceInstructions was updated to print the instructions or show an error message if decoding was impossible.
- Tests included

Differential Revision: https://reviews.llvm.org/D89283
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
The file was modifiedlldb/source/Target/ProcessTrace.cpp
The file was addedlldb/test/API/commands/trace/intelpt-trace-multi-file/libbar.so
The file was modifiedlldb/source/Commands/Options.td
The file was addedlldb/test/API/commands/trace/intelpt-trace-multi-file/bar.cpp
The file was modifiedlldb/include/lldb/Symbol/SymbolContext.h
The file was addedlldb/test/API/commands/trace/intelpt-trace/trace_bad_image.json
The file was modifiedlldb/source/Target/TraceSessionFileParser.cpp
The file was addedlldb/test/API/commands/trace/intelpt-trace-multi-file/multi-file-no-ld.json
The file was modifiedlldb/source/Commands/CommandObjectThread.cpp
The file was addedlldb/source/Plugins/Trace/intel-pt/IntelPTDecoder.h
The file was addedlldb/source/Plugins/Trace/intel-pt/DecodedThread.h
The file was modifiedlldb/source/Symbol/SymbolContext.cpp
The file was modifiedlldb/packages/Python/lldbsuite/test/lldbtest.py
The file was addedlldb/source/Plugins/Trace/intel-pt/IntelPTDecoder.cpp
The file was addedlldb/test/API/commands/trace/intelpt-trace-multi-file/foo.h
The file was modifiedlldb/test/API/commands/trace/TestTraceDumpInstructions.py
The file was modifiedlldb/include/lldb/Core/Disassembler.h
The file was addedlldb/test/API/commands/trace/intelpt-trace-multi-file/foo.cpp
The file was addedlldb/test/API/commands/trace/intelpt-trace-multi-file/multi-file.trace
The file was addedlldb/test/API/commands/trace/intelpt-trace-multi-file/bar.h
The file was modifiedlldb/source/Core/Disassembler.cpp
The file was addedlldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp
The file was modifiedlldb/source/Target/Trace.cpp
The file was addedlldb/test/API/commands/trace/intelpt-trace-multi-file/libfoo.so
The file was addedlldb/test/API/commands/trace/intelpt-trace/trace_wrong_cpu.json
The file was addedlldb/test/API/commands/trace/intelpt-trace-multi-file/a.out
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
The file was addedlldb/test/API/commands/trace/intelpt-trace-multi-file/main.cpp
The file was modifiedlldb/include/lldb/Target/Trace.h
The file was modifiedlldb/source/Plugins/Trace/intel-pt/CMakeLists.txt
Commit 9914a8737f527bd065e3ac9b119c5bdb1762ac3a by clementval
[flang][openacc] Add parsing tests and semantic check for set directive

This patch add some parsing and clause validity tests for the set directive.
It makes use of the possibility introduces in patch D90770 to check the restriction
were one of the default_async, device_num and device_type clauses is required but also
not more than once on the set directive.

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D90771
The file was modifiedllvm/include/llvm/TableGen/DirectiveEmitter.h
The file was modifiedllvm/include/llvm/Frontend/OpenACC/ACC.td
The file was modifiedflang/test/Semantics/acc-clause-validity.f90
The file was modifiedllvm/utils/TableGen/DirectiveEmitter.cpp