[ADT] Use isComparableWith in SmallPtrSet (#221020)
This patch updates operator== in SmallPtrSet to use
DebugEpochBase::HandleBase::isComparableWith, bringing it in line with
DenseMap, FoldingSet, and StringMap.
Assisted-by: Antigravity
Make Younan Zhang happy and enhance deduction guide for type aliases to support template template parameters and reorder synthesized parameters accordingly
[clang] remove unused NestedNameSpecifier 'Invalid' constructor
These invalid NNS were used as thombstone keys for DenseMap, but
the DenseMap implementation changed and that's not needed anymore.
[FoldingSet] Assert inserted node's profile matches its lookup (#220166)
In FoldingSetImpl::insert, assert the node profile matches the insert
token. Otherwise, a memoized node can never be matched, leading to
missing hash consing.
This would catch SelectionDAG's and clang's missing CSE bugs (#219911,
#220168)
[clang][bytecode] Allocate EvalEmitter locals using InterpState allocator (#220922)
They have the same lifetime, so might as well use the existing
allocator.
[mlir][linalg] Preserve cast semantics in named contraction vectorization (#216283)
This patch fixes correctness issues in named contraction vectorization
of Linalg ops whose operands require conversion to an integer
accumulator type.
When `create_named_contraction` is enabled, an op such as `linalg.matmul
{cast = #linalg.type_fn<cast_unsigned>}` was lowered directly to a
mixed-width `vector.contract` without materializing the implied
`arith.extui`. Since `vector.contract` promotes mixed-width integer
operands using sign extension, an `i8 x i8 -> i32` matmul could
interpret unsigned inputs as signed values and produce incorrect
results.
Floating-point operands were similarly passed directly to
`vector.contract` without materializing the `arith.fptosi` or
`arith.fptoui` conversion implied by the Linalg cast semantics.
Materialize `arith.extui` for narrower unsigned integer inputs and
[5 lines not shown]
[IR] Add source location filtering to pass dumps (#203393)
Large dumps from `-print-after-all` can be hard to use when only a few
source lines matter. Function filtering can still print too much and can
miss code after inlining.
Add `-filter-print-source-locs` to limit IR and machine-function dumps
to matching debug locations. The option accepts file names or paths with
selected lines and ranges. It also follows inlined locations and works
with legacy and new pass managers.
[CIR][OpenCL] Emit OpenCL language version metadata in CIR
Emit OpenCL and C++ for OpenCL language version attributes from CIRGen. Preserve the compatible OpenCL version and the C++ for OpenCL version separately so later lowering does not infer one from the other.
Assisted-by: Codex / GPT-5.6 Sol
[CIR][OpenCL] Lower OpenCL language version metadata to LLVM dialect
Propagate CIR OpenCL language version module attributes as LLVM dialect named metadata before LLVM IR translation.
Assisted-by: Codex / GPT-5.6 Sol
[CIR][OpenCL] Add OpenCL language version module attributes
Add structured CIR module attributes for OpenCL and C++ for OpenCL language versions. Verify their module-level placement and version components so lowering can consume explicit source-language version state.
Assisted-by: Codex / GPT-5.6 Sol
[LoongArch][MC] Add assembly syntax highlighting for LoongArch (#218946)
This PR adds color highlighting of registers and immediates in LoongArch
disassembly.
This is similar to #65853.
[RISCV] Andes: model fast unaligned accesses (#220756)
Mark the Andes 45 tuning profile as supporting efficient unaligned
scalar loads and stores. This lets fixed-size alignment-one copies lower
to scalar instructions instead of a memcpy call. On these in-order
cores, where performance is almost synonymous with instruction count,
this is a material win.
[AArch64] Form CCMP for CBB and CBH
AArch64ConditionalCompares forms CMP/CCMP chains to transform patterns
such as
Head Head
/ | CmpBB
/ | / |
| CmpBB => / |
| / | Tail |
| / | | |
Tail | | |
| | | |
... ... ... ...
where Head is terminated by a conditional branch and CmpBB contains
a cmp + conditional branch.
We usually try to split any fused conditional branches to be able to
[8 lines not shown]
[AArch64][CMPBR] Fix splitting of CBB/CBH instructions into ext + cmp
We falsely split CBB/CBH instructions by explicitly extending the
second register operand instead of the first one, leading to the
following, wrong codegen:
cbh $wn, $wm, cc, trgt => sxth $wt, $wm
cmp $wn, $wt, cc, sxth
Correct is
cbh $wn, $wm, cc, trgt => sxth $wt, $wn
cmp $wt, $wm, cc, sxth
since cmp with extended register extends it's second, not its first
operand.
[AArch64] Allow forming CCMPs for CB branches
AArch64ConditionalCompares currently doesn't consider FEAT_CMPBR CB
instructions when trying to form CCMPs. This leads to a lot more
branches which is usually hurtful for performance.
The patchs adds handling CB instructions, just like we do for other
fused conditional branches such as CBZ or CBNZ.
[mlir][openacc] Add isCompilerGenerated to GlobalVariableOpInterface (#221096)
This function is used to determine if a global is compiler generated or
coming from user variables. This is useful when determining the handling
of globals for unified memory mode.
[AArch64] Fix missing :lo12: on the catchret address pair (#219200)
`llc -mtriple=aarch64-pc-windows-msvc` emits assembly it cannot assemble
itself.
A function with a `catchret` materialises its continuation block like
this:
```asm
"?catch$2@?0?f at 4HA":
adrp x0, .LBB0_1
add x0, x0, .LBB0_1
ret
```
Pipe that back through `llvm-mc` and you get:
```
error: expected compatible register, symbol or integer in range [0, 4095]
add x0, x0, .LBB0_1
[43 lines not shown]
[clang][OpenMP] Add explicit default libomp value to test. (#221098)
The test OMPInvariantPredicateBoundOnIntraTileLoop, in AttrTest.cpp uses
'-fopenmp' without supplying an explcit value. In some places the
default value is 'libomp', which works just fine for this test. But in
envorinments where 'libomp' is not the default value (e.g. places that
use 'libgomp' by default) the test fails. This fixes that issue by
explicitly telling the test to use 'libomp'.
[mlir][gpu] Don't request C wrappers for private device functions (#214552)
GPU lowerings attach `llvm.emit_c_interface` to device functions
regardless of visibility. This causes private device functions to
receive external entry points and prevents such functions from being
culled by DCE.
On a real module lowered by a downstream compiler, we measured that
unconditional `llvm.emit_c_interface` inflated the generated PTX by 1.8x
by keeping unused private functions alive and by 7x for pipelines that
also give private functions internal linkage.
This change attaches `llvm.emit_c_interface` only to functions which are
not private for both the gpu->nvvm and gpu->rocdl lowerings. No behavior
change to existing unit tests, and new tests are added to witness the
new behavior for private functions.
Assisted-by: Claude Code
[DebugInfo] Ignore undefined constexpr constructors in constructor homing. (#218165)
The constructor homing optimization limits the amount of redundant debug
info generated for classes by only emitting forward declarations to
debug info in translation units that can't instantiate the class on
their own (i.e. they don't see the definitions of any constructors).
Currently, classes that have _any_ constexpr constructors are excluded
from the optimization. This is being changed to only exclude _defined_
constexpr constructors, as declared constexpr constructors are not
callable in a TU that doesn't see their definition.
Signed-off-by: Clayton Knittel <cknit1999 at gmail.com>
[ORC] Add host-jit-triple lit feature, gate some JIT tests (#220929)
The JIT does not support throwing exceptions on Darwin/arm64e yet. Add
an llvm-lit feature flag, "host-jit-triple", that reports the process
triple as detected by `lli` so that we can mark exception-throwing tests
as unsupported when they would be run as arm64e. (Feature flags based on
build settings, e.g. host-triple and target-triple, don't reliably
report arm64e).
Adds a -host-jit-triple option to lli to print the value for the
feature-flag.
rdar://185482009