[SelectionDAG] Preserve exact when SimplifyDemandedBits narrows SRL (#235548)
Preserve the `exact` flag when narrowing SRL so a shift combine can drop
a redundant `AND`.
Fixes #231378
[AMDGPU] Price under-aligned memory operations (#233262)
Without unaligned access for the address space, an access aligned below
4 bytes is split into pieces of its alignment. LDS accesses aligned to 4
use 8-byte pieces, and take a 12-byte piece only when aligned to 16 or
when unaligned DS access is enabled.
Assisted-By: Claude Code Opus 5
[AMDGPU] Price memory operations by the number of memory instructions (#233261)
Price a load or store as the number of memory instructions it is split
into.
Constant and buffer "fat" pointers are left alone (for now).
Assisted-By: Claude Code Opus 5
[LoopIdiom] Add a range attribute to formed memset/memcpy/memmove (#226801)
[LoopIdiom] Add a range attribute to formed memset/memcpy/memmove
Attach a range attribute to the length (or, for memset.pattern, the count)
operand. The upper bound comes from the loop's constant maximum backedge-taken
count, and is only recorded if the length is at most 2^16. For a loop like
this...
for (unsigned short i = 0; i < n; ++i)
dst[i] = 0;
...the memset gets `i64 range(i64 0, 65536)`.
LoopIdiomRecognize applies this to memset, memset.pattern, memcpy and memmove
calls.
PR: https://github.com/llvm/llvm-project/pull/226801
Assisted-by: Claude
[NFC][clang][Driver] Collapsed If statements with same return into a single statement in CreateFileHandler (#238231)
This is an NFC PR. It collapses `if` statements with the same `return`
into a single statement. It makes future additions to the code easier
and makes the code more readable.
[SLP] Give failed seed a try
Previously, with the following vectorizable code:
y = x * x * x;
where IR ordered the code as:
sq = x * x;
y = sq * x;
If the seed is [sq0, y0, sq1, y1] and the cost model rejects
vectorizing sq0 and sq1, y0 will be bypassed without any retry in `I
+= ActualVF - 1`.
To fix this, we give skipped nodes a chance by using them as the root
of the tree and rebuilding it. In the retry logic, we starts from
bring the child of failure match (sq0,sq1) but uses FirstSkipped as
the filter. In here, [y0, y1] will be the new User to go
TryVectorizeWindow. If it still fails, it tried to bring its child in
as the next level try. For example, [sq0, y0, z0, sq1, y1, z1]. [y0,
y1] will brings [z0, z1] in until converge.