[lldb] Handle staticmethod/classmethod descriptors in ScriptedPythonInterface (#170188)
Extract `__func__` attribute from staticmethod/classmethod descriptors
before treating them as callables. Python's `@staticmethod` and
`@classmethod` decorators wrap methods in descriptor objects that are
not directly usable as PythonCallable, when calling PyCallable_Check.
The actual callable function is stored in the `__func__` attribute of
these descriptors, so we need to unwrap them to properly validate and
invoke the decorated methods in scripted interfaces.
Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>
[lldb] Unify DW_OP_deref and DW_OP_deref_size implementations (#169587)
This commit unifies the code in the dwarf expression evaluator that
handles these two deref operations. Previously we had similar, but not
identical code for handling them.
The implementation was taken from the DW_OP_deref_size code path since
that handles the general case. We put that code into an
Evaluate_DW_OP_deref_size function and call it with the address size
when evaluating DW_OP_deref.
There were initially two test failures when I made the change. The
`DW_op_deref_no_ptr_fixing` unittest failed because we were not
correctly setting the address size when we created the DataExtractor.
The `DW_OP_deref test` failed because previously the expression
`DW_OP_lit4, DW_OP_deref` would evaluate to a LoadAddress, but the code
for deref_size was evaluating it to a scalar.
The difference was in how it handled a deref of a scalar value type. In
[12 lines not shown]
[rtsan] Handle attributed IR function declarations (#169577)
Addresses https://github.com/llvm/llvm-project/issues/169377.
Previously, the RealtimeSanitizer pass only handled attributed function
_definitions_ in IR, and we have recently found that attributed function
_declarations_ caused it to crash. To fix the issue, we must check
whether the IR function is empty before attempting to do any
manipulation of its instructions.
This PR:
- Adds checks for whether IR `Function`s are `empty()` ~~in each
relevant~~ at the top-level RTSan pass routine
- ~~Removes the utility function `rtsanPreservedCFGAnalyses` from the
pass, whose result was unused and which would otherwise have complicated
the fix~~
[mlir] Add missing pad reshape propagation patterns (#168888)
The existing `FoldPadWithProducerReshapeOpByExpansion` and
`FoldPadWithProducerReshapeOpByCollapsing` patterns did not cover all
reshape propagation cases, because they only consider cases where the
pad op is the consumer operation. This PR adds 2 new patterns to cover
the cases where the pad op is the producer operation, which completes
the propagation pattern set for pad op with expand_shape and
collapse_shape.
Note for integration: This PR also removes the single user restriction
for the `FoldPadWithProducerReshapeOpByExpansion` and
`FoldPadWithProducerReshapeOpByCollapsing` patterns, which leaves more
control to the users of the pattern. If this constraint is needed, then
it should be added to the control function for these patterns.
---------
Signed-off-by: Max Dawkins <max.dawkins at gmail.com>
[clang] Handle null dtor decl during consumed analysis (#170180)
See similar PR #169593.
This is another case where null was not handled when returned from
`getDestructorDecl`.
[mlir][acc] Add acc serial to acc parallel conversion (#170189)
This patch introduces a new transformation pass that converts
`acc.serial` constructs into `acc.parallel` constructs with
num_gangs(1), num_workers(1), and vector_length(1).
The transformation is semantically equivalent since an OpenACC serial
region executes sequentially, which is identical to a parallel region
with a single gang, worker, and vector. This unification simplifies
processing of acc regions by enabling code reuse in later compilation
stages.
Co-authored-by: Vijay Kandiah <vkandiah at nvidia.com>