The uArch infrastructure provides:
- A set data structures to represent, uArch and it's necessary
components (e.g., instructions, register-files, caches).
- A set of utility interfaces that are common to a family of ops (e.g.,
mma ops, 2DBlockIO ops). The implementation of these interfaces are
provided by the specific instructions. Each family of ops provides these
5 common APIs. However, some family of ops may have more utility APIs.
The common 5 APIs are:
- getSupportedShapes
- getSupportedTypes
- checkSupportedShapesAndTypes
- checkSupportedTypes
- validate
Add support for PVC and BMG architectures.
Add support for DPAS instruction.
DW_OP_LLVM_extract_bits_zext and DW_OP_LLVM_extract_bits_sext can end up
emitting "DW_OP_constu 0; DW_OP_shr" when given certain arguments.
However, a shift by zero is not useful, and so it can be omitted.
This is unnecessary. At use emission time, InstrEmitter will
use the common subclass of the value type's register class and
the use instruction register classes. This removes one of the
obstacles to treating special case instructions that do not have
the alignment requirement overly conservatively.
Currently, LLDB in FreeBSD host sets the Process Architecture used by
lldbserver as Default one. Which cause problem when trying to debug a
32bit binary on amd64 platform since the lldb itself will found mismatch
architecture with lldbserver's return.
Notice that this patch is only a partial fix for the debugging problem.
We are still unable to debug x86 on x86_64 so that we don't provide
testcase in this patch.
See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289945
This is a follow-up PR for post-commit comments in #128782 .
- Fix variable name to camel case.
- Change the output format to make it easier to handle with FileCheck.
- Regenerate assertions of regression tests.
This patch starts to find terminator from `VarDecl`'s end location
rather than it's `getLocation()` to ignore terminator(`,`) in function
paramaters list.
Kind of follow up to #112091Closes#161978 .
The complexity of maintaining an extra kind of metrics have not
justified itself, as it is not used upstream, and we have only a single
use of boolean stats per entrypoint downstream.
As I will do downstream, you can use an unsigned statistic type with
values 0 and 1 to model a boolean flag.
--
CPP-7097
[AMDGPU][GlobalISel] Add register bank legalization for
G_SMIN/G_SMAX/G_UMIN/G_UMAX
This patch adds register bank legalization support for min/max
operations in the AMDGPU GlobalISel pipeline.
- Add support S16, S32, and V2S16 types
- For V2S16 uniform operations implements UnpackMinMax lowering
- Make instruction arguments to the `misexpect` functions const and drop
const for `ArrayRef` arguments.
- Remove namespace llvm/misexpect surrounding all the code in .cpp file
and instead use `using namespace`.
- Change static helper functions to also use const references or
pointers when possible.
Using SlotIndexes::getMBBEndIdx() isn't the correct choice here because
it returns the starting index of the next basic block, causing live-ins
of the next block to be calculated instead of the intended live-outs of
the current block.
Add SlotIndexes::getMBBLastIdx() method to return the last valid
SlotIndex within a basic block, enabling correct live-out calculations.
Restructure the C++ Lifetime Safety Analysis into modular components
with clear separation of concerns.
This PR reorganizes the C++ Lifetime Safety Analysis code by:
1. Breaking up the monolithic `LifetimeSafety.cpp` (1500+ lines) into
multiple smaller, focused files
2. Creating a dedicated `LifetimeSafety` directory with a clean
component structure
3. Introducing header files for each component with proper documentation
4. Moving existing code into the appropriate component files:
- `Checker.h/cpp`: Core lifetime checking logic
- `Dataflow.h`: Generic dataflow analysis framework
- `Facts.h`: Lifetime-relevant events and fact management
- `FactsGenerator.h/cpp`: AST traversal for fact generation
- `LiveOrigins.h/cpp`: Backward dataflow analysis for origin liveness
- `LoanPropagation.h/cpp`: Forward dataflow analysis for loan tracking
- `Loans.h`: Loan and access path definitions
- `Origins.h`: Origin management
- `Reporter.h`: Interface for reporting lifetime violations
- `Utils.h`: Common utilities for the analysis
The code functionality remains the same, but is now better organized
with clearer interfaces between components.
We lower signed divides by a power-of-two to ASRD. However, ASRD's
immediate is log2(shift_amount) in the range 1 to elt-bitwidth, which
means it cannot represent sdiv-by-one.
Fixes https://github.com/llvm/llvm-project/issues/162616
In order to make this easier, I also removed all "removeFromParent"
calls from the visitors, instead adding instructions
to a set of instructions to delete once the function has been visited.
This avoids crashes due to functions deleting their operands. In theory
we could allow functions to delete the
instruction they visited (and only that one) but I think having one
idiom for everything is less error-prone.
Fixes#140219
Having both SVE and SME environments essentially means the majority of
SVE2 instructions are always available. This PR reflects this at the
builtins level whereby +sve+sme is enough to enable this subset.
It's a similar story for +sve2p1 whereby the feature means a subset of
SME2 instructions are always available.
- Moved existing testcases from
```llvm/test/CodeGen/X86/fast-isel-fneg.ll``` to
```llvm/test/CodeGen/X86/isel-fneg.ll```.
- Added **x86_fp80** testcase and **GISEL** RUN lines as precommit
testcases for GISEL.
- Two i686 testcases are disabled because it is crashing in later passes
only for GISEL. It will resolve after adding **FNEG GISEL
implementation**, I will add that in next PR.
When the underlying storage element is 32-bit, we may only need half of
the last value in the uint64_t array. I've adjusted the constructor to
account for that.
For example, if you construct a 65 bit bitset you will need both 32-bit
halves of the first array value but only the bottom half of the second
value. The storage will only have 3 elements, so attempting to assign
the top 32-bits into the storage will fail.
This happened on our buildbot:
https://lab.llvm.org/buildbot/#/builders/154/builds/22555
(though the traceback is not useful)
Then added tests for < 32 bit sizes, and assertions for the number of
elements we decide to use. Given that the only member of BitSet is a
std::array, I think the size will be consistent across systems.
Tested on 32 and 64-bit Arm machines.
Follow up to #162703.
Some createTempFromMold users are looking for a compile time constant
for the `mustFree`. Instead of having them retrieving it, update the
interface to return a bool. The only users that needs a value was
`packageBufferizedExpr` and it has an overload that accept bool too.
Tests are updated to reflect that this changes the place where the
boolean is created in BufferizeHLFIR, and just removes its creation in
contexts it is not needed.
GVN currently has two different implementation of equality propagation.
One of them is used for branch conditions (dominating an edge), which
performs replacements across multiple blocks. This is also used for
assumes to handle uses outside the current block.
However, uses inside the block are handled using a completely separate
implementation, which involves populating a replacement map and then
checking it for individual instructions during normal GVN. While this
approach generally makes sense, it is kind of pointless if we already do
a use walk to handle the cross-block case anyway.
This PR generalizes propagateEquality() to accept either a
BasicBlockEdge or an Instruction* and replace dominated users. This
removes the need for special handling of uses in the same block for
assumes, as they're covered by instruction dominance, and ensures that
both implementations do not go out of sync.
From clang version 4, mips append new instruction BeqImm and
BEQLImm, the second operand format of instruction is imm64:$imm.
1.When Mips process `beql $t0, ($t0), 1`, it think the second operand
was an imm, so match success. Then mips backend process expandBranchImm,
check the second operand `$t0` was not imm, reported asserts.
We can strengthen the second operand matching restrictions.
2.Similarly, when Mips process `beql $t0, (1), 1`, it think the second
was an imm. so match success. Then mips backend process expandBranchImm,
check the third operand `1` was not expression, reported asserts. Permit
the third operand of `beql` to be imm.
Fixes#151453.
SPS deserialization for span<const char> produces a value that points
directly into the argument buffer for efficiency. This was broken by an
unnecessary std::move of the buffer inside WrapperFunction, which this
commit removes.
This is a step towards separating the set of available libcalls
from the lowering decision of which call to use. Libcall recognition
now directly checks availability instead of indirectly checking through
the lowering table.
Add a new m_PtrToIntOrAddr() matcher which matches both ptrtoint and
ptrtoaddr. Pointer arithmetic only works on the address bits, so
supporting ptrtoaddr is always fine here.
This change adds a new folding pattern, folding a G_FPEXT(G_FCONSTANT)
to a G_FCONSTANT.
To make this work on AArch64, the `G_FCONSTANT` should not be widened
due to the `G_FCONSTANT` being converted to a `G_CONSTANT`. This should
fix some other floating point combines when the `G_FCONSTANT` is widened
due to being an fp16.
This test was broken by
https://github.com/llvm/llvm-project/pull/162714. Previously the
`[[clang::opencl_private]]` attribute was applied first, resulting in
the clashing `__global` attribute being ignored. Now that `__global` is
applied first, it results in an error, and then
`[[clang::opencl_private]]` is applied, resulting in another error.
Fixes some followup issues from clangd/clangd#529.
`\note` and `\warning`:
In the hover card, they are now displayed with heading and enclosing
rulers.
`\retval` commands:
Each `\retval` command is now a bullet point under the return section of
the hover card.
Added a Markdown preprocessing step before parsing the documentation
with the doxygen parser.
This mainly replaces markdown code blocks with `@code...@endcode`
commands.