[SelectionDAGISel][TableGen] Remove trailing 0 from isel table. NFC (#178744)
I suspect this was here to prevent a trailing comma. If we actually
reach this byte in isel, it will be treated as OPC_Scope not a
terminator.
[AArch64] Optimize memset to use NEON DUP instruction for more sizes (#166030)
This change improves memset code generation for non-zero values on
AArch64 by using NEON's DUP instruction instead of
the less efficient multiplication with 0x01010101 pattern.
For small sizes, the value is extracted from a larger DUP. For
non-power-of-two sizes, overlapping stores are used in some cases.
TargetLowering::findOptimalMemOpLowering is modified to allow explicitly
specifying the size of the constant in cases where the constant is
larger than the store operations.
Fixes #165949
[GlobalISel] Fold Add Shift combine from SelectionDAG (#177371)
This PR adds the combine rule `fold (add x, shl(0 - y, n)) -> sub(x,
shl(y, n))` to GlobalISel, corresponding to an existing SelectionDAG
combine in
[DAGCombiner::visitADDLikeCommutative](https://github.com/llvm/llvm-project/blame/fcba3040107944604904aeb146c26ec0628160f4/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp#L3367).
Co-authored-by: Sarah Kuhn <sarahlinhkuhn at gmail.com>
---------
Co-authored-by: Sarah Kuhn <sarahlinhkuhn at gmail.com>
Co-authored-by: Luisa Cicolini <48860705+luisacicolini at users.noreply.github.com>
[lldb-dap] Improve DetectReplMode (#178740)
When DetectReplMode is called without a valid frame, we cannot check if
an expression refers to a variable in scope.
This avoids unnecessary checks when completing expressions.
[analyzer] Fix [[clang::suppress]] for tricky template specializations (#178441)
The code assumed that taking the lexical parent decl context of a node
and traversing it will eventually visit the node itself. While this is
certeanly true for most AST constructs, template specializations (aka.
instantiations) might inject their AST to surprising lexical parents,
depending on when they get instantiated.
This means that just taking the lexical parent of a template
specialization might land us on some AST node that won't contain (thus
visit) the definition, and consequently, miss the Suppress attribute...
To fix this, we must take special care for template specializations. For
a regular instantiation select the primary template (that has the definition).
For an instantiation coming from a partial specialization, pretend if it
was the partial specialization instead.
Once we canonicalize to the primary template/partial specialization
definition, the usual "walk the lexical parents" logic covers the rest
[4 lines not shown]
[HLSL] Add wave prefix count bits function (#178059)
This PR adds the WavePrefixCountBits function to HLSL, including spirv
and DXIL code generation.
Fixes https://github.com/llvm/llvm-project/issues/99171
[HLSL] Make round, trunc, floor overload tests stricter. NFC (#178508)
This patch changes the run lines for round, trunc, floor overload test
to use -O1 instead of -disable-llvm-passes and rewrite the tests to
actually look at the whole function.
This work is part of https://github.com/llvm/llvm-project/issues/138016.
[HLSL] Make atan, sin, sqrt overload tests stricter. NFC (#177702)
This patch changes the run lines for atan, sin, sqrt overload test to
use -O1 instead of -disable-llvm-passes and rewrite the tests to
actually look at the whole function.
This work is part of https://github.com/llvm/llvm-project/issues/138016.
[HLSL] Make log2, tan overload tests stricter. NFC (#177700)
This patch changes the run lines for log2, tan overload test to use -O1
instead of -disable-llvm-passes and rewrite the tests to actually look
at the whole function.
This work is part of https://github.com/llvm/llvm-project/issues/138016.
[HLSL] Make step, isinf, rsqrt overload tests stricter. NFC (#177697)
This patch changes the run lines for step, isinf, rsqrt overload test to
use -O1 instead of -disable-llvm-passes and rewrite the tests to
actually look at the whole function.
This work is part of https://github.com/llvm/llvm-project/issues/138016.
[HLSL] Make log, asin, acos overload tests stricter. NFC (#177664)
This patch changes the run lines for log, asin, acos overload test to
use -O1 instead of -disable-llvm-passes and rewrite the tests to
actually look at the whole function.
This work is part of https://github.com/llvm/llvm-project/issues/138016.
[HLSL] Make frac, tanh, degrees overload tests stricter. NFC (#177657)
This patch changes the run lines for frac, tanh, degrees overload test
to use -O1 instead of -disable-llvm-passes and rewrite the tests to
actually look at the whole function.
This work is part of https://github.com/llvm/llvm-project/issues/138016.
[HLSL] Make cosh, exp, normalize overload tests stricter. NFC (#177507)
This patch changes the run lines for cosh, exp, normalize overload test
to use -O1 instead of -disable-llvm-passes and rewrite the tests to
actually look at the whole function.
This work is part of https://github.com/llvm/llvm-project/issues/138016.
---------
Co-authored-by: Joao Saffran <jderezende at microsoft.com>
[lldb] Make `print` delegate to synthetic frames.
This patch is more of a proposal in that it's a pretty dramatic change to the way that `print` works. It completely delegates getting values to the frame if the frame is synthetic, and does not redirect at all if the frame fails.
For this patch, the main goal was to allow the synthetic frame to bubble up its own errors in expression evaluation, rather than having errors come back with an extra "could not find identifier <blah>" or worse, simply get swallowed. If there's a better way to handle this, I'm more than happy to change this as long as the core goals of 'delegate variable/value extraction to the synthetic frame', and 'allow the synthetic frame to give back errors that are displayed to the user' can be met.
stack-info: PR: https://github.com/llvm/llvm-project/pull/178602, branch: users/bzcheeseman/stack/7
[lldb] Add support for ScriptedFrame to provide values/variables.
This patch adds plumbing to support the implementations of StackFrame::Get{*}Variable{*} on ScriptedFrame. The major pieces required are:
- A modification to ScriptedFrameInterface, so that we can actually call the python methods.
- A corresponding update to the python implementation to call the python methods.
- An implementation in ScriptedFrame that can get the variable list on construction inside ScriptedFrame::Create, and pass that list into the ScriptedFrame so it can get those values on request.
There is a major caveat, which is that if the values from the python side don't have variables attached, right now, they won't be passed into the scripted frame to be stored in the variable list. Future discussions around adding support for 'extended variables' when printing frame variables may create a reason to change the VariableListSP into a ValueObjectListSP, and generate the VariableListSP on the fly, but that should be addressed at a later time.
This patch also adds tests to the frame provider test suite to prove these changes all plumb together correctly.
stack-info: PR: https://github.com/llvm/llvm-project/pull/178575, branch: users/bzcheeseman/stack/6
[lldb] [disassembler] chore: add GetVariableAnnotations to SBInstruction api (#177676)
## Description
Contribution to this topic [Rich Disassembler for
LLDB](https://discourse.llvm.org/t/rich-disassembler-for-lldb/76952),
this part.
```
The rich disassembler output should be exposed as structured data and made available through LLDB’s scripting API so more tooling could be built on top of this
```
----
This pr replaces #174847
As was suggested in [this
comment](https://github.com/llvm/llvm-project/pull/174847#issuecomment-3757015552),
implement access to variable annotations from `SBInstruction` class
itself.
[36 lines not shown]
[lldb] Make `print` delegate to synthetic frames.
This patch is more of a proposal in that it's a pretty dramatic change to the way that `print` works. It completely delegates getting values to the frame if the frame is synthetic, and does not redirect at all if the frame fails.
For this patch, the main goal was to allow the synthetic frame to bubble up its own errors in expression evaluation, rather than having errors come back with an extra "could not find identifier <blah>" or worse, simply get swallowed. If there's a better way to handle this, I'm more than happy to change this as long as the core goals of 'delegate variable/value extraction to the synthetic frame', and 'allow the synthetic frame to give back errors that are displayed to the user' can be met.
stack-info: PR: https://github.com/llvm/llvm-project/pull/178602, branch: users/bzcheeseman/stack/7
[lldb] Add support for ScriptedFrame to provide values/variables.
This patch adds plumbing to support the implementations of StackFrame::Get{*}Variable{*} on ScriptedFrame. The major pieces required are:
- A modification to ScriptedFrameInterface, so that we can actually call the python methods.
- A corresponding update to the python implementation to call the python methods.
- An implementation in ScriptedFrame that can get the variable list on construction inside ScriptedFrame::Create, and pass that list into the ScriptedFrame so it can get those values on request.
There is a major caveat, which is that if the values from the python side don't have variables attached, right now, they won't be passed into the scripted frame to be stored in the variable list. Future discussions around adding support for 'extended variables' when printing frame variables may create a reason to change the VariableListSP into a ValueObjectListSP, and generate the VariableListSP on the fly, but that should be addressed at a later time.
This patch also adds tests to the frame provider test suite to prove these changes all plumb together correctly.
stack-info: PR: https://github.com/llvm/llvm-project/pull/178575, branch: users/bzcheeseman/stack/6
[flang][OpenMP] Leave local automatic variables alone
There is code in resolve-directives.cpp that tries to apply DSA flags
to symbols encountered inside constructs. This code was written with
the assumption that all such symbols will be declared outside of the
construct.
When a symbol declared in a BLOCK construct nested in a construct was
found, the code would attempt to either privatize or share it in the
enclosing construct (where the symbol didn't exist) leading to trouble.
BLOCK constructs (and thus the possibility of having local variables)
was introduced in F2008.
The first OpenMP spec that considered F2008 was 5.0, where the behavior
of the BLOCK construct was explicitly left unspecified.
From OpenMP 5.1 onwards, all local non-static variables are private
in the construct enclosing the declaration. This PR extends this behavior
retroactively to all prior OpenMP versions.
Fixes https://github.com/llvm/llvm-project/issues/178613
[lldb] Add conversions for SBValueList and SBValue to the python bridge. (#178574)
This patch adds support for:
- PyObject -> SBValueList (which was surprisingly not there before!)
- PyObject -> SBValue
- SBValue -> ValueObjectSP using the ScriptInterpreter
These three are the main remaining plumbing changes necessary before we can get to the meat of actually using ScriptedFrame to provide values to the printer/etc. Future patches build off this change in order to allow ScriptedFrames to provide variables and get values for variable expressions.
[InlineSpiller] Hoist spills only when all of its subranges are available (#177703)
Context:
https://github.com/llvm/llvm-project/issues/176001#issuecomment-3793846479
When we're hoisting a spill to another block, and storing one of its
sibling values there instead, we need to make sure all sub ranges of
that sibling value is alive at the insertion point. Otherwise, we might
accidentally store compromised subranges values back to the spill slot.
[LLDB][Statistics] Add coreFile to Target stats (#161448)
This patch adds the coreFilePath, if applicable, to the target
statistics for LLDB. My primary motivation here is sanity check user
reports when they say I had an issue with a specific corefile and then
validating it was in fact that specifies corefile, as right now there is
no guaruntee the filename and the process/target name will be the same.
[lldb] Move ValueImpl and ValueLocker to ValueObject, NFC. (#178573)
This patch moves ValueImpl and ValueLocker to ValueObject.{h,cpp}. This follows the example set in TypeImpl/SBType, where we have something that SBType uses internally that needs to be exposed in the layer below. In this case, SBValue uses ValueImpl, which wraps ValueObject. The wrapper helps avoid bugs, so we want to keep it, but the script interpreter needs to use it and said interpreter is conceptually *below* the SB layer...which means we can't use methods on SBValue.
This patch is purely the code motion part of that, future patches will actually make use of this moved code.