Previously, only the tests that are generated by the gen-test could be
marked as UNSUPPORTED. After this patch, the gen-test itself can be
marked as UNSUPPORTED, which makes it possible to add RUN lines that
would be an error when unsupported to the gen-test itself.
The ValueEvolution logic is deeply flawed, and checking that zero-bits
are shifted can be exploited for miscompiles. In an effort to redo
HashRecognize with a pattern-matching based approach, extract and fix
the core logic of ValueEvolution, and strip it completely, showing that
none of the tests rely on the KnownBits computation of ValueEvolution.
Co-authored-by: Piotr Fusik <p.fusik@samsung.com>
There are two classes of operands that DecoderEmitter cannot currently
handle:
1. Operands that do not participate in instruction encoding.
2. Operands whose encoding contains only 1s and 0s.
Because of this, targets developed various workarounds. Some targets
insert missing operands after an instruction has been (incompletely)
decoded, other take into account the missing operands when printing the
instruction. Some targets do neither of that and fail to correctly
disassemble some instructions.
This patch makes it possible to decode both classes of operands and
allows to remove existing workarounds.
For the case of operand with no contribution to instruction encoding,
one should now add `bits<0> OpName` field to instruction encoding
record. This will make DecoderEmitter generate a call to the decoder
function specified by the operand's DecoderMethod. The function has a
signature different from the usual one and looks like this:
```
static DecodeStatus DecodeImm42Operand(MCInst &Inst, const MCDisassembler *Decoder) {
Inst.addOperand(MCOperand::createImm(42));
return DecodeStatus::Success;
}
```
Notably, encoding bits are not passed to it (since there are none).
There is nothing special about the second case, the operand bits are
passed as usual. The difference is that before this change, the function
was not called if all the bits of the operand were known (no '?' in the
operand encoding).
There are two options controlling the behavior. Passing an option
enables the old behavior. They exist to allow smooth transition to the
new behavior. They are temporary (yeah, I know) and will be removed once
all targets migrate, possibly giving some more time to downstream
targets.
Subsequent patches in the stack enable the new behavior on some in-tree
targets.
This patch consolidates two implementations of getHashValueImpl into
one with "constexpr if", which should be more readable than the
SFINAE-based approach.
The same applies to isEqualImpl.
This fully annotates the code completion classes (CompletionChunk,
CompletionString, CodeCompletionResult, CodeCompletionResults and
CCRStructure) resolving 59 strict typing errors as the next step towards
#76664
fix: #151716
In #65918, support of incomplete array type is added in
TryReferenceListInitialization. It causes the crash in Constant Expr
Calculation since it only considers the case where it is
ConstantArrayType.
This patch wants to add support for incomplete array type also.
The operand is not encoded, decoded, or printed and would break MCInst
verification if we had one.
Extracted from #156358, where the extra operand causes DecoderEmitter
to emit an error about an operand with a missing encoding.
Update the AVX2/AVX512 min/max integer intrinsics to be constexpr
compatible.
This PR is a follow-up to #156678. The AVX512 mask/maskz variants will
be addressed in the next follow-up.
Part of #153153.
In CallAndMessageChecker the initialization of bug types was highly
obfuscated (even compared to other `mutable std::unique_ptr` hacks).
This commit cleans up this situation and removes a totally superfluous
hidded 'modeling' sub-checker that did not have any role apart from
obstructing the normal initialization of bug types.
(Note that if we need to reintroduce CallAndMessageModeling in the
future, we can do it cleanly within the CheckerFamily framework, so we
wouldn't need to re-obfuscate the bug type initialization.)
This change is mostly non-functional, the only visible change is the
removal of the hidden modeling checker.
…resent
The OpenMP spec 4.5-5.1 defines ORDERED as standalone when a DEPEND
clause is present (with either SOURCE or SINK as argument). The OpenMP
spec 5.2+ defines ORDERED as standalone when a DOACROSS clause is
present.
In the attached test case, the global variable later only points to
gargbage, because the MaterializeTemporaryExpr used to initialize it is
a local variable, which is gone by the time we try to evaluate the
store.
Fixes#156223
Part of the logic in this parser was dealing with a list of executable
constructs that begins with BLOCK. Since after 6b92a3bc21cdc we're doing
it via a lookahead, this handling can be simplified.
TestGetBaseName.py is currently marked as an expected failure on Windows
because SBFunction::GetBaseName() and SBSymbol::GetBaseName() don’t yet
handle MSVC-style mangling.
This patch updates the @expectedFailureAll decorator to include a
reference to https://github.com/llvm/llvm-project/issues/156861
This fixes an issue with #150791. In CheckRunner, we treat files with
unrecognized extensions as ".cpp", by forcefully assigning `extension =
".cpp"` if it's not already one of `".c", ".hpp", ".m", or ".mm"`. Make
the new code which chooses the default `-std` argument be consistent
with that, so that using other file extensions doesn't trigger an error
message like `error: invalid argument '-std=c99' not allowed with 'C++'`
This patch adds a new `TargetLowering` hook `lowerEHPadEntry()` that is
called at the start of lowering EH pads in SelectionDAG. This allows the
insertion of target-specific actions on entry to exception handlers.
This is used on AArch64 to insert SME streaming-mode switches at landing
pads. This is needed as exception handlers are always entered with
PSTATE.SM off, and the function needs to resume the streaming mode of
the function body.
DynamicLoaderWindowsDYLD uses pointers to Modules to maintain a map
from modules to their addresses, but it does not need to keep "strong"
references to them. Weak pointers should be enough, and would allow
modules to be released elsewhere.
Other DynamicLoader classes do not use shared pointers as well. For
example, DynamicLoaderPOSIXDYLD has a similar map with weak pointers.
Actually testing for modules being completely released can be tricky.
The test here is just to illustrate the case where shared pointers kept
modules in DynamicLoaderWindowsDYLD and prevented them from being
released. The test executes the following sequence:
1. Create a target, load an executable and run it.
2. Remove one module from the target. The target should be the last
actual use of the module, but we have another reference to it in the
shared module cache.
3. Call MemoryPressureDetected to remove this last reference from the
cache.
4. Replace the corresponding DLL file.
LLDB memory maps DLLs, and this makes files read-only on Windows. Unless
the modules are completely released (and therefore unmapped), (4) is
going to fail with "access denied".
However, the test does not trigger the bug completely - it passes with
and without the change.
Update code comments and variable/function names to make it more clear
that we handle trunc instructions (and not only sext/zext) when
extracting constant offsets from a GEP index expressions.
This for example renames the vector ExtInsts to CastInsts.
ClangSACheckersEmitter.cpp had some comments that described the
structure of its output, which would have been helpful, but became out
of sync with the code. This commit updates them to ensure they are
consistent with `CheckerRegistry.cpp`.
Scalable masked loads and stores with a get active lane mask whose size
is less than or equal to the scalable minimum number of elements can be
be proven to have a fixed size. Adding this infomation allows scalable
masked loads and stores to benefit from alias analysis optimizations.
Update evaluatePtrAddrecAtMaxBTCWillNotWrap to support non-constant
sizes in dereferenceable assumptions.
Apply loop-guards in a few places needed to reason about expressions
involving trip counts of the from (BTC - 1).
PR: https://github.com/llvm/llvm-project/pull/156758