[lldb] Consolidate ScriptedThreadPlan state into ScriptedMetadata (#199064)
This is a follow-up to 1b4a578a9f77.
Replace ScriptedThreadPlan's separate `m_class_name` and `m_args_data`
members with a single `m_scripted_metadata`, and update its constructor,
Thread::QueueThreadPlanForStepScripted and the SB/CLI callers to take a
`const ScriptedMetadata &` directly. Drop the now-redundant `args_sp`
parameter from ScriptedThreadPlanInterface::CreatePluginObject; the
Python override constructs a StructuredDataImpl from the metadata's args
dict for the dispatched call.
ScriptedThreadPlan keeps its own `m_scripted_metadata` member because
the interface's metadata is only set when `DidPush()` calls
`CreatePluginObject`, so the plan needs to hold the metadata between
construction and `DidPush()`.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
[lldb] Consolidate Target Hook/StopHook scripted state into ScriptedMetadata (#199088)
This is a follow-up to 1b4a578a9f77.
Replace `Target::HookScripted`'s and `Target::StopHookScripted`'s
separate `m_class_name` and `m_extra_args` members with a single
`m_scripted_metadata`, and update `SetScriptCallback to take a `const
ScriptedMetadata &` directly. Drop the now-redundant `args_sp` parameter
from ScriptedHookInterface::CreatePluginObject and
ScriptedStopHookInterface::CreatePluginObject; the Python overrides
construct a StructuredDataImpl from the metadata's args dict for the
dispatched call.
Each hook subclass keeps its own `m_scripted_metadata` member because
the interface's metadata is only set when SetScriptCallback runs the
Python override of CreatePluginObject; the hook needs to hold the
metadata between construction and that callback. Read-side description
printing goes through the new GetScriptClassName() helper which
delegates to m_interface_sp->GetScriptedMetadata(). The two
[3 lines not shown]
[Instrumentor][FIX] Ensure we indicate changes properly. (#199106)
We now indicate changes whenever we might have changed things even if
the filter will rule out instrumentation. The issue was that we need to
get the argument to check the filter and that process might create new
IR, e.g., a global variable containing the function name.
[CI] Remove unnecessary PR validation
There's no reason to try to verify the PR number here - if it's not correct
we error out anyway, so just ignore it entirely and pull the information in
directly from github.
[CIR] Wide String literals in a larger variable lowering (#198966)
This showed up in a test suite: If the size of the variable is larger
than the literal, we were asserting since we were only accounting for a
single null terminator. The FE will ensure that we have enough room for
the variable + a null terminator, but the size must be larger!
This patch counds on 'trailing-zeroes' to make sure the null terminator
is in place.
[CIR] Fix cast kind to support bool in builtin_*_overflow (#198958)
'bool' is an acceptable type to the __builtin_*_overflow functions, but
we were unconditionally doing an integral cast. This adds some logic to
do a bool-to-int cast if necessary.
[CIR] Implement lowering of atomic-func ptrs (#199045)
This actually is a near-zero effort implementation, since other than an
assertion, we had everything correct. It isn't clear where that
assertion came from (other than an over abundance of caution?). It
doesn't exist in classic codegen, which always counts on the
fallthrough.
However, we ARE missing some ptr-auth work in that area, so a
MissingFeatures is added to be a placeholder for it.
[CIR] Fix Cmp-Xchg generation when casting to int (#198924)
We have logic in CIRGenAtomic to handle 'cast float to an int', which
works for most of our atomics. However, compare-exchange uses a second
'val' value, which was not getting cast, which caused a verification
error.
This patch ensures that the correct cast is generated for 'val2' as
well.
[clang-doc] Use explicit for single param constructors (#198068)
This trips up some clang-tidy checks, so add the explicit keyword as
needed to satisfy the lints.
[CIR] Add CallConvLowering pass + Direct/Ignore ABI rewriting (#195737)
Depends on #195725 (merged).
Stacked on #195725 (PR A1). The diff in this PR is the CIR side; A1 has
the dialect-agnostic infrastructure.
Adds the `cir-call-conv-lowering` pass plus the `CIRABIRewriteContext`
skeleton with handlers for Direct (true pass-through) and Ignore (drop
empty-record args/returns). Subsequent PRs in the split add Extend,
Direct-with-coercion + a new reinterpret op, Indirect/sret,
Indirect/byval, and Expand — each is purely additive because the
rewriter dispatches on `argClass.kind` via a switch with explicit "not
yet implemented" diagnostics for every other kind.
The pass takes one of two driver options: `target=test` uses the test
target from PR A1, and `classification-attr=<name>` reads a pre-built
`DictionaryAttr` from each `cir.func` (also via the helper from PR A1).
It also requires `dlti.dl_spec` on the module and emits a clear
[20 lines not shown]
[Instrumentor][FIX] Ensure we indicate changes properly.
We now indicate changes whenever we might have changed things even if
the filter will rule out instrumentation. The issue was that we need to
get the argument to check the filter and that process might create new
IR, e.g., a global variable containing the function name.
[CI] Unify handling of scripted PR workflows
A few workflows already force the use of baseline scripting when
testing PRs. This PR pulls that out into a separate action that
we can just reuse in other workflows as well.
[AMDGPU] Don't insert delay_alu for 1 waves-per-eu (#198638)
These instructions are used to improve hardware utilization rates in the
multi-wave case. In the 1 wave per eu case these do not help and just
add extra instructions.
[clang-doc][nfc] Silence tidy warning about anonymous namespace
clang-tidy complains that we should prefer static over the anonymous
namespace, despite the API being static in addition to being in the
anonymous namespace. We can silence the diagnostic by simply removing
the namespace declaration.
[clang-doc] Use explicit for single param constructors
This trips up some clang-tidy checks, so add the explicit keyword as
needed to satisfy the lints.
[llvm][Instrumentor] Fix non-determinism in Instrumentor (#198833)
In InstrumentorStubPrinter the StringMap was being iterated over, which
broke the Instrumentation/Instrumentor/write_config.ll test under
LLVM_REVERSE_ITERATION builds. We can use a MapVector to ensure the
order is stable. We only need to update the test json ordering to match
the stable order for with and without LLVM_REVERSE_ITERATION.
[clang-doc] Clean up inconsistent namespace usage in BitcodeWriter (#198067)
Typically we forgo prefixing things with clang::doc or llvm:: unless
they overlap with something in std::, like `to_underlying()`. We also
group things to avoid non-internal symbols by placing types in the
anonymous namespace, and more logically grouping things that don't need
to be in the clang::doc namespace.
[clang-doc][nfc] Silence tidy warning about anonymous namespace
clang-tidy complains that we should prefer static over the anonymous
namespace, despite the API being static in addition to being in the
anonymous namespace. We can silence the diagnostic by simply removing
the namespace declaration.
[clang-doc] Use explicit for single param constructors
This trips up some clang-tidy checks, so add the explicit keyword as
needed to satisfy the lints.
[clang-doc] Clean up inconsistent namespace usage in BitcodeWriter
Typically we forgo prefixing things with clang::doc or llvm:: unless
they overlap with something in std::, like `to_underlying()`. We also
group things to avoid non-internal symbols by placing types in the
anonymous namespace, and more logically grouping things that don't need
to be in the clang::doc namespace.