[OpenMP] Prevent parser infinite loop on unimplemented clauses (#198796)
This is to fix an infinite loop in the parser when using un-implemented
clauses. See https://godbolt.org/z/f775asrea .
This patch also fixes this crash: https://godbolt.org/z/WKrsbTGGe .
[VPlan] Assert that replacement types match in VPUser::setOperand (NFC). (#195891)
Add assertion to VPValue::setOperand to check if types of the new
operand matches the old operand.
This makes it easier to catch replacements with incorrect types at the
source, instead only later during verification.
A few places currently preform replacements with mis-matching types,
which only get fixed up later. Update those to avoid type-violation.
Depends on https://github.com/llvm/llvm-project/pull/195485
PR: https://github.com/llvm/llvm-project/pull/195891
[mlir][IR] Require token producer and consumer traits
Add marker traits for operations that intentionally produce or consume the
builtin token type. The verifier now rejects token results without
TokenProducerTrait, token operands without TokenConsumerTrait, token entry
block arguments whose parent op does not produce tokens, and token block
arguments outside entry blocks.
Extend the Test dialect token ops to cover valid opt-in cases and each
verifier rejection path.
Assisted-by: Codex
[RISCV][TTI] Model broadcast loads as zero-stride loads (#198446)
We have done this optimization in ISel and this PR just models it
in TTI.
---------
Co-authored-by: Luke Lau <luke_lau at icloud.com>
[AIX] Remove unsupported AIX native echo option -n (#199079)
AIX native echo doesn't support the `-n` flag.
Use the POSIX-standard `\c` escape sequence instead to suppress the
trailing newline, ensuring the test works across all systems and make it
portable.
The current test fails as follows:
```
FAIL: lit :: unit/Util.py (1 of 1)
******************** TEST 'lit :: unit/Util.py' FAILED ********************
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
"/opt/freeware/bin/python3.12" /home/himadhit/llvm/community/build/utils/lit/tests/unit/Util.py
# executed command: /opt/freeware/bin/python3.12 /home/himadhit/llvm/community/build/utils/lit/tests/unit/Util.py
[20 lines not shown]
[SPIRV][NFC] Pass function-pointer operand explicitly to visitFunPtrUse (#197667)
Take the function-pointer placeholder operand as a parameter rather
than reading MI.getOperand(2) directly, so visitFunPtrUse can be
reused from instructions with a different operand layout. Pure
refactor.
---------
Co-authored-by: Marcos Maronas <mmaronas at amd.com>
[ELF] Remove the symbol partition feature (#199186)
Follow-up to #198718: SHT_LLVM_SYMPART sections are no longer recognized
and are treated as ordinary sections.
The sole user has been retired (crbug.com/401249151).
The per-partition synthetic sections (.dynamic, .dynsym, .gnu.hash,
.eh_frame, .ARM.exidx, ...) move into `ctx.in`; the program headers move
into `ctx.phdrs`. Delete the `Partition` struct, `ctx.mainPart`,
`ctx.partitions`, the
PartitionElfHeaderSection/PartitionProgramHeadersSection shim sections,
and the `.part.end` marker.
[MLIR][Linalg] Specialize more binary elementwise ops (#192290)
Extends the matching logic for `linalg.generic` ops that can be
represented as named op or `linalg.elementwise` to cover all variants
currently supported by `RegionBuilderHelper::buildBinaryFn`. We
previously detected only `add`, `sub`, `mul` and `div` for floating
point types.
I combined the detection for unary and binary functions to make it
tractable to morph operations such as
```mlir
#map = affine_map<(d0) -> (d0)>
// ...
%c123_i32 = arith.constant 123 : i32
%0 = linalg.generic
{indexing_maps = [#map, #map], iterator_types = ["parallel"]}
ins(%A : tensor<?xi32>) outs(%Out : tensor<?xi32>) {
^bb0(%in: i32, %out: i32):
%v = arith.addi %c123_i32 , %in : i32
[12 lines not shown]
[clang] Avoid invalidating specialization lookup (#196533)
Fixes a use-after-free in `ASTReader::LoadExternalSpecializationsImpl`
when loading external specializations with `-ftime-trace` enabled.
This resolves the https://github.com/llvm/llvm-project/issues/196482 and
builds upon the https://github.com/llvm/llvm-project/pull/172658
The function kept a pointer into `SpecLookups`:
```cpp
LookupTable = &It->getSecond();
```
Then it constructed a `TimeTraceScope` whose name callback calls
`getNameForDiagnostic`. That call may deserialize additional AST state
and mutate `SpecLookups`, invalidating the saved pointer before it is
later used for:
[27 lines not shown]
[Driver][MSVC] Correctly handle the -fuse-ld=(empty) case (#199167)
We need to distinguish the case where `-fuse-ld` is unspecified and when
`-fuse-ld=(empty)` as is already done in the generic `ToolChain`
implementation but wasn't done in the MSVC driver to correctly handle
the `CLANG_DEFAULT_LINKER` CMake option.