[LLVM][Intrinsics] Eliminate range check for IIT table in `DecodeIITType` (#190260)
`DecodeIITType` does a range check each time the next entry from the IIT
encoding table is read. This is required to handle IIT encodings that
are in-lined into the `IIT_Table` entries, since the `IITEntries` array
in `getIntrinsicInfoTableEntries` is terminated after the last non-zero
nibble is seen in the inlined encoding (but that may not be the actual
end). Change this code to instead have the `IITEntries` array for the
inlined case point to the full `IITValues` array payload + a IIT_Done
terminator, so that such entries look exactly like they would if they
were encoded in the long encoding table and then remove the range check
in `DecodeIITType` to streamline that code a bit.
Additionally, change some use if 0s (in loop conditions and default
constructed terminator in the IIT long encoding table) to explicitly use
IIT_Done to clarify the code better.
Also use `consume_front()` in a few places instead of `front()` followed
by `slice(1)`.
[NFC][LLVM] Rename IRBuilder/LLVM C API params for overload types (#191674)
Rename IRBuilder and LLVM C API function params for overload types to
use names to better reflect their meaning.
[clang][bytecode] Stop using QualTypes when checking evaluation results (#191732)
They might not match the descriptor contents exactly, so just look at
the descriptors.
[VPlan] Handle calls in VPInstruction:opcodeMayReadOrWriteFromMemory. (#190681)
Retrieve the called function and check its memory attributes, to
determine if a VPInstruction calling a function reads or writes memory.
Use it to strengthen assert in areAllLoadsDereferenceable.
PR: https://github.com/llvm/llvm-project/pull/190681
[clang-format] treat continuation as indent for aligned lines (#191217)
This allows to inherit tabbed indent from the lines we break by the
lines we want to align. Thus in the AlignWithSpaces mode aligned lines
do not generate smaller indent than those they are aligned to.
[Clang][diagtool] Fix memory leak in ShowEnabledWarnings (#191711)
Fix 136-byte memory leak introduced in commit 6dc059ac3c7c. Before
that commit, the TextDiagnosticBuffer was passed to DiagnosticsEngine
constructor which took ownership and managed its lifetime. After the
refactoring, the buffer is no longer passed to DiagnosticsEngine, so
it becomes an orphaned allocation that is never freed. Changed to use
std::unique_ptr for automatic cleanup.
[llubi] Fix invalid printf format specifier for %c (#191713)
Fix ASAN warning about unexpected format specifier %llc introduced
in commit f149ab665a4b. The 'c' format specifier should not have the
'll' length modifier. Separated the 'c' case to use the correct format
without the length modifier, casting to int as required by the standard.
[AsmPrinter] Fix redundant/weaker .prefalign when IR align attr >= prefalign (#191675)
PR #155529 (only fired with -ffunction-sections, then modified by PR
184032) compared `MF->getAlignment()` (the backend's minimum function
alignment) against `MF->getPreferredAlignment()` to decide whether to
emit `.prefalign`. This ignored the IR function's own align attribute,
which `emitAlignment` picks up later via `getGVAlignment`, so the
comparison was against the wrong minimum.
Consequences on x86 (backend min = 1, target pref = 16):
* `[[gnu::aligned(32)]] void g(){}` lowers to `align 32 prefalign(32)`.
.p2align 5
.prefalign 5, .Lfunc_end, nop
The .prefalign is fully redundant: .p2align 5 already forces the
desired 32-byte alignment.
[9 lines not shown]
[SLP] Fix GEP cost computation for load vectorization cost estimates
Pass Instruction::Load instead of Instruction::GetElementPtr to
getGEPCosts in isMaskedLoadCompress and CheckForShuffledLoads.
These call sites estimate costs for wide contiguous loads and sub-vector
load patterns, not for masked gather pointer vector formation. Using
Instruction::GetElementPtr incorrectly triggered the gather-style cost
path, which computes vector GEP formation costs. Since the call sites
already add scalarization overhead for pointer vector building
separately, this led to double-counting of pointer costs and inaccurate
vectorization decisions.
Reviewers: hiraditya, RKSimon
Pull Request: https://github.com/llvm/llvm-project/pull/191728
[ORC] Move MemoryAccess ownership out of ExecutorProcessControl. (#191715)
Similar to the DylibManager change in e55fb5de0f9, this removes an
unnecessary coupling between ExecutorProcessControl and MemoryAccess,
allowing clients to select MemoryAccess implementations independently.
To simplify the transition, the
ExecutorProcessControl::createDefaultMemoryAccess method will return an
instance of whatever MemoryAccess the ExecutorProcessControl
implementation had been using previously.
ValueTracking: Handle frexp exp in computeKnownConstantRange
Compute the bounds based on the known exponent range.
Only handles IEEE cases since I don't see an easy way to
get the bounds in general.
Test uses instcombine instead of checking for the range
attribute, since apparently attributor doesn't handle introducing
range attributes from computeConstantRange.
[SLP]Fix dominance failure when value is copyable in one PHI entry but non-copyable in another
When a value is treated as a copyable element in one tree entry and as a
non-copyable element in another, both feeding into PHI nodes, the
scheduler could produce vectorized IR where an instruction does not
dominate all its uses. Bail out of scheduling in tryScheduleBundle when
this conflict is detected to prevent generating broken modules.
Fixes #191714
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/191724