[llvm] Remove unused DenseMapInfo::getEmptyKey (#201996)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[mlir] Remove unused DenseMapInfo::getEmptyKey (#201991)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[clang-tidy] Fix `altera-id-dependent-backward-branch` false positives (#200660)
The check unconditionally marked the LHS of any assignment from a
variable or field as ID-dependent. As a result, ordinary assignments
like `x = y` or `i += chunk_size` could trigger false positives in later
loop conditions.
Only propagate ID-dependency when the RHS variable or field is already
known ID-dependent.
Based on the fix by @yeputons, with helper renaming and extra tests for
ordinary assignments, fields, macros, aliases, cv/ref cases, lambdas,
templates, concepts, and the #53777 range-for case.
Fix #52790
Fix #53777
Assisted by Codex.
[VPlan] Only print original trip count if it is used. (#202069)
Similarly to other VPlan-scope values, only print trip count when it has
users for consistency.
[InstCombine] Fix incorrect insert point when folding zext of deinterleave (#201977)
Fix invalid module crash in
https://github.com/llvm/llvm-project/pull/195330#issuecomment-4635245035
The problem was caused by incorrect IRBuilder insertion point. The
insertion point used when generating new instructions might not dominate
all the de-interleave fields users. This patch fixes this issue by
explicitly setting the insertion point to either
`llvm.vector.deinterleave2` or the earliest `shufflevector` instruction
(in the de-interleaving group) within the same basicblock.
[ASan] Skip high-shadow and gap setup when HighMem region is empty (#202037)
On targets where the shadow offset sits above all addressable user
memory (e.g. Alpha with ASAN_SHADOW_OFFSET=0x70000000000 and a 42-bit
user VAS), kHighMemBeg is set above kHighMemEnd so the HighMem region is
empty. Since MEM_TO_SHADOW is monotonically increasing, kHighMemBeg >
kHighMemEnd implies kHighShadowBeg > kHighShadowEnd. Calling
ReserveShadowMemoryRange(kHighShadowBeg, kHighShadowEnd) passes size =
kHighShadowEnd - kHighShadowBeg + 1, which underflows to a large
negative value, and mmap() fails with ENOMEM.
ProtectGap is also skipped: there is no meaningful shadow gap between
LowShadow and an empty HighShadow.
Guard both operations on kHighMemBeg <= kHighMemEnd.
[BOLT] Remove unused DenseMapInfo::getEmptyKey (#201986)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[Polly] Remove unused DenseMapInfo::getEmptyKey (#201992)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[lld] Remove unused DenseMapInfo::getEmptyKey (#201989)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[Target] Remove unused DenseMapInfo::getEmptyKey (#201993)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[ADT] Don't use getEmptyKey() when hashing std::optional (#202002)
DenseMapInfo<std::optional<T>>::getHashValue() calls T's getEmptyKey()
for the nullopt case. This blocks removing the now-unused getEmptyKey()
from DenseMapInfo specializations: a leaf type that drops getEmptyKey()
fails to compile wherever std::optional<T> is used as a DenseMap key
(e.g. DenseMapInfo<mlir::spirv::StorageClass>).
Compute the hash directly instead. Prerequisite for the getEmptyKey()
removal series; #201281 made getEmptyKey() unused by DenseMap.
[flang] Remove unused DenseMapInfo::getEmptyKey (#201988)
After #201281 DenseMapInfo<T>::getEmptyKey() is no longer used by
DenseMap. Remove the unused getEmptyKey definitions and dead sentinel
uses.
[clang-doc] Clean up implementation with better casting
Having access to RTTI style casting lets us use slightly nicer
structures to clean up the overly complicated dispatch logic in merging
and other places.
[clang-doc] Use llvm RTTI over handrolled casting
Clang-Doc has a limited amount of polymorphism over Info types.
Historically, these have just been cast directly in a few places, but we
can use the existing llvm RTTI implementation to more rigorously
dispatch and query the types involved with only limited extra code.
This should make future changes a bit harder to get wrong.
[clang-doc] Move Generator classes into the anonymous namespace
Clang-Tidy suggest moving these classes into the anonymous namespace,
to enforce internal linkage.
[lldb] Add SBDebugger::SetTerminalDimensions to set width and height atomically (#201965)
Terminal width and height were communicated to the debugger separately,
via SetTerminalWidth() and SetTerminalHeight(). Each notified the
IOHandler and the statusline, so on a resize they recomputed their
layout twice: once with one dimension updated and the other still stale.
Add Debugger::SetTerminalDimensions(width, height) (exposed through
SBDebugger) that updates both properties before notifying, and
reimplement the single-axis setters and the driver's resize handler in
terms of it.
Also fix SBDebugger::GetTerminalHeight(), which returned the width.
[NFC][LLVM] Introduce `IIT_MATCH` to represents `LLVMMatchType` (#202034)
Currently, the fully dependent identity type `LLVMMatchType` is
represented in the IIT encoding table as `IIT_ANY` with `AK_MatchType`
argument kind. Instead, add a new IIT code `IIT_MATCH` to represent such
dependent types, so that `IIT_ANY` is used to represent just the core
overload types.
[clang-repl] Fix Value's move ctor releasing storage on construction (#200888)
Value::Value(Value &&) called Release() on the just-moved-into storage,
decrementing the refcount to zero on the only remaining reference.
Subsequent reads -- including ~Value() running clear(), which calls
Release() a second time on the now-freed allocation -- hit
use-after-free.
The move should transfer the existing reference: the source clears
IsManuallyAlloc so its destructor will not Release, and *this assumes
ownership of the same refcount. Neither side needs to Retain or Release
to keep the count correct.
Add a regression test exercising move-construction, move-assignment, and
follow-on copy-construction on a K_PtrOrObj Value. AddressSanitizer
catches the bug without the fix.
[InstCombine] Drop `ninf` FMF when input element can be `Inf` in shuffle-select transform (#201315)
Solves https://github.com/llvm/llvm-project/issues/74326
When binary operation has `ninf` FMF, but the input does not have
`nofpclass(inf)`, we should not propagate the `ninf` FMF. Because the
transformation may produce poison value when the input has an `Inf`
element, whereas the original code will simply pass through the `Inf`
element.
Alive proof: https://alive2.llvm.org/ce/z/nkv-vE