RISCV: Fix ensureDominates crashes on operands without a vreg def
ensureDominates used an unchecked getVRegDef on every register
operand. This crashed on physical register uses or undef vregs. Also
fix dropping an incoming undef flag which would fail the verifier.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[AARCH64][COST]Cost non-pow2 i1 vector bitcast to int
No bitmask lowering for non-pow2 i1 vectors; lanes are extracted and
packed one by one. Price extracts plus N-1 combines instead of a
single cross-bank move.
Required to avoid regressions in non-power-of-2 SLP support
Assisted-by: Cursor
Reviewers: paulwalker-arm, huntergr-arm, sdesmalen-arm, davemgreen
Pull Request: https://github.com/llvm/llvm-project/pull/238357
RuntimeLibcalls: Add missing attributes to memory and allocator libcalls
Add the attributes inferLibFuncAttributes would give these functions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Move malloc, calloc and free attributes to TableGen
This requires new attribute plumbing for attributes that have an
argument value.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[github] Remove stale CODEOWNERS entries
GitHub reports that three existing owners no longer satisfy CODEOWNERS
access requirements. Their entries were added in 2024. Remove the invalid
owners while retaining the other reviewers for each path.
LLM-aided
TableGen: Error on allocatable register classes with an empty allocation order
A register can never be allocated from a class with an empty
allocation order. This can happen when an alternative order excludes
every member, or when an inferred class inherits such an order from
its super class.
Classes with no members are exempt, since AMDGPU's VReg_1 is a verfy
hacky, intentionally empty allocatable class.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[libc] Use fast day-of-week and time-of-day algorithms in time_utils (#238163)
Add two constexpr helpers to time_utils.h and use them in
update_from_seconds:
- get_weekday(unix_days): Ben Joffe's mul-add-shift weekday algorithm
(https://www.benjoffe.com/fast-day-of-week). Because 7 = 2^3 - 1,
x mod 7 == floor(x * 8 / 7) mod 8. Multiplying by ceil(2^64 / 7) and
adding a rotation constant puts the weekday in the top 3 bits. It is
valid for about +/-631 trillion years, well beyond the range accepted
by update_from_seconds.
- get_time_of_day(seconds_of_day): Ben Joffe's "V2 - Fixed-Point Hi/Low
Bits" algorithm (https://www.benjoffe.com/fast-time-of-day). It splits
seconds into hour, minute and second with four multiplications and no
division. Hour and minute come from the high and low bits of one
product and the second comes from a separate product, so the two run
in parallel instead of the hour -> remainder -> minute -> second chain.
It is valid for [0, 2255818].
[43 lines not shown]
[clang] Fix CODEOWNERS errors for ClangIR
GitHub reports an unknown owner for the ClangIR rules. Remove Lanza from
all four active ownership rules and retain an emeritus owner comment.
This can be revisited if write access is restored.
LLM-aided
[LLVM] Silence a deprecation warning; NFC (#241008)
MSVC deprecation warnings are a bit more aggressive than Clang and GCC
warnings in that calling a deprecated from another deprecated function
is still diagnosed.
LLVMCreateBuilder itself is deprecated, so that's why this is silenced
for Clang and GCC already.
[RISCV][P-ext] Lower 2 element insert_vector_elt to scalar_to_vec+ppaire/ppaireo.
This avoids needing to match the srl+build_vec later which we only
do on RV64.