[libc++] Add a compact, bounded iterator (#208271)
- By taking advantage of unused alignment bits for a pointer of type `T`
and the static capacity known at compile time, we can make a compact
bounded iterator who's size == `sizeof(T*)` by stuffing a counter inside
those bits.
- This new iterator type is `static_packed_bounded_iterator<class _Ptr, size_t _RangeCapacity>` and is only valid if:
- `_Ptr` is a pointer
- `_RangeCapacity` is <= `(1 << (bit_width(alignof(T)) - 1)) - 1`. The
extra -1 is required, because we need to represent the end position past
the last element.
---------
Co-authored-by: Louis Dionne <ldionne.2 at gmail.com>
[clang-tidy] Add detection of decltype(nullptr) => std::nullptr_t to modernize-use-nullptr (#224591)
Hidden behind an option switch, but on by default.
[RISCV] Add UImmLsbZeroAsmOperand class to use isUImmShifted<N, S> as the PredicateMethod. NFC (#224789)
Allows us to remove some wrappers from RISCVAsmParser.
[SelectionDAG] Document that UADDO/USUBO_CARRRY follow getBooleanContents. NFC (#224764)
Use 'true' instead of '1'.
Follow up from post commit discussion in #223396.
[DAGCombiner] Restrict combineOrOfSetCCToUSUBOCarry to ZeroOrOneBooleanContent. (#224759)
We need to ensure the carry in matches boolean contents. We are checking
MaskedValueIsZero which is only valid for ZeroOrOneBooleanContent.
We could check ComputeNumSignBits for ZeroOrNegativeOneBooleanContent,
but no in tree target supports USUBO_CARRY and
ZeroOrNegativeOneBooleanContent.
This was an oversight in #223396 due to incorrect documentation for
USUBO_CARRY. I will fix that in a separate patch.
[flang][OpenMP] Reword some diagnostic messages, NFC
Instead of "something...something in OpenMP vX.Y on SOME clause" say
"something...something on SOME clause in OpenMP vX.Y".
[Mips] Fix O32 lowering on 64-bit CPUs (#224937)
Use 32-bit GPR lowering for O32 while preserving the selected ISA and
FPR mode. Handle FP64 transfers through the stack when high-half moves
are unavailable.
[AMDGPU] Remove dead function and method declarations (NFC) (#224889)
createLowerWWMCopiesPass:
Added on July 28, 2023 in commit
4d42e8b5d1fa87e49768d100dd1bc53515391e89 without a definition or any
callers.
createAMDGPUReserveWWMRegsPass:
Added on September 30, 2024 in commit
ac0f64f06d67a93817ccd9a3c529ad40920115c9 without a definition or any
callers.
createAMDGPUStructurizeCFGPass:
The definition and callers were removed on June 19, 2013 in commit
d46fce11412636ec9cca038e1f2b1addf1690f00.
AMDGPUTargetLowering::LowerSTORE:
The definition was split into R600TargetLowering::LowerSTORE and
SITargetLowering::LowerSTORE on February 11, 2016 in commit
[55 lines not shown]
[AMDGPU] Return zero LDS encoding granularity for dummy targets
Remove the redundant early return and assertion from getLDSEncodingGranule. Return zero when the target has no encoding granularity feature, and document and test the result for unknown and legacy generic targets.
Keep the existing 256-byte default in the assembly printer so compiling without a GPU still produces valid LDS sizes. Test default-target Mesa and PAL encodings and HSA metadata.
Change-Id: Ia0c69a0d7ce2858b31ee64100d37ae34bba6c42c
[LoongArch] Drop asm part from memory barrier optimization pass (#223656)
Drop the inline asm part from #218597, which violates inline assembly
semantics.
CodeGen: Pass instruction and operand index to isPCRelRegisterOperandLegal (#219420)
Replace the MachineOperand argument to the
TargetInstrInfo::isPCRelRegisterOperandLegal hook with the containing
instruction and operand index. The M68k implementation only used the
operand
to recover its parent instruction and operand number, so this drops the
dependence on MachineOperand::getParent().
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[flang][OpenMP] Add -fopenmp-version flag to several tests
The default OpenMP version in flang is 3.1. A number of tests use features
added in later versions. They currently pass because the version validity
is not enforced in many cases. Set the OpenMP version explicitly to avoid
failures when the checks become more strict.
[X86][APX] Fix EFLAGS reuse across cycles (#223613)
optimizeCompareInstr's multi-predecessor NF reuse (added in
ab39c491430e) did not scan the below-CmpInstr region of CmpMBB when
CmpMBB was on a CFG cycle: that region is on the back-edge path but is
scanned by neither the caller nor the helper's predecessor walk. A
non-NF-convertible EFLAGS clobber there (e.g. an unrelated CMP feeding a
JCC, as in the reproducer below with VUCOMISS/CTEST/COPY-\$eflags) still
let the helper delete the redundant compare and mark \$eflags live-in on
CmpMBB. That broke the reused EFLAGS on iteration 2+ and tripped
X86FlagsCopyLowering's SuccMBB == TestMBB self-loop check with a fatal
report_fatal_error when a preexisting COPY \$eflags save/restore sat in
the cycle.
Reproducer: https://godbolt.org/z/s58j5zxqd
Detect CmpMBB on a cycle via a forward-reachability BFS on its
successors and, when so, scan from just after CmpInstr to the block's
end: bail on any non-NF-convertible EFLAGS clobber, stage NF-convertible
[10 lines not shown]
[X86] getPSHUFShuffleMask - use PSHUFD/LW/HW decodes directly. NFC. (#224900)
Don't bother going through getTargetShuffleMask and checking for a
repeated lane mask when all we care about is the mask[4] permute mask -
PSHUFLW/HW don't even need the full 128-bit lane mask!