[mlir][Presburger] Add IntegerRelation::gist (context-based simplification)
Add IntegerRelation::gist(context), a port of ISL's isl_basic_map_gist
(uset_gist / uset_gist_full), along with the supporting row-reduction
helpers IntMatrix::rowReduce and IntegerRelation::reduceUsingEqualities.
Supporting helpers:
- IntMatrix::rowReduce: performs Gauss-Jordan row reduction in place
along a caller-specified column order, swapping pivot rows to the top,
normalizing modified rows by GCD, and returning the pivot columns
(with unit tests in MatrixTest.cpp).
- IntegerRelation::eliminateVarUsingEquality(ArrayRef, col): eliminates
a variable from every constraint using an external equality row.
- IntegerRelation::reduceUsingEqualities: orchestrates IntMatrix::rowReduce
to project context equalities onto involved variables, detect
inconsistent equalities, and rewrite all constraints of a relation
using the remaining equalities (port of ISL's
isl_basic_set_reduce_using_equalities with project_onto_involved).
[58 lines not shown]
[mlir][Presburger] NFC: extract eliminateColumnUsingRow and eliminateVarUsingEquality
Extract IntMatrix::eliminateColumnUsingRow (eliminating a column from a
row using a pivot row with the smallest positive multiplier on the row)
and IntegerRelation::eliminateVarUsingEquality (applying it to every
other equality and every inequality of the relation).
Replace the file-local eliminateFromConstraint helper with these
primitives in gaussianEliminateVars, gaussianEliminate, and
removeRedundantLocalVars, and add a unit test for
IntMatrix::eliminateColumnUsingRow.
[Clang][AMDGPU] Remove redundant isAMDGCN checks. NFC
After the r600 target removal, AMDGPUTargetInfo is only created for
the amdgcn triple, so every `isAMDGCN()` check in it is always true.
Drop those checks and the helpers that only wrapped them.
```
if (hasFMAF())
Builder.defineMacro("__HAS_FMAF__");
-->
Builder.defineMacro("__HAS_FMAF__");
```
RFC: https://discourse.llvm.org/t/rfc-amdgpu-deprecating-and-removing-llvm-s-r600-terascale-backend/92840
[Clang][AMDGPU] Remove R600 target support
Remove the r600 triple from the clang frontend, driver and CodeGen,
together with the `__R600__` macro and the `__builtin_r600_*` builtins.
AMDGPUTargetInfo now only handles amdgcn, so the R600 branches are gone.
```
$ clang --target=r600 -S test.cl
error: unknown target triple 'r600'
```
RFC: https://discourse.llvm.org/t/rfc-amdgpu-deprecating-and-removing-llvm-s-r600-terascale-backend/92840
[clang-tidy] Respect explicit(false) on conversion operators (#240521)
Commit eb3b063995d6 (#82689) taught `ExplicitConstructorCheck`
(`misc-explicit-constructor`, aliased as `google-explicit-constructor`
and `cppcoreguidelines-explicit-constructor`) to ignore C++20
`explicit(false)` and instantiation-dependent `explicit(...)`
expressions on constructors, and to diagnose non-literal `false`
expressions without emitting an invalid `explicit` fix-it.
However, the `CXXConversionDecl` branch still unconditionally warned on
any conversion operator where `isExplicit()` was false and suggested
inserting `explicit `, even when `explicit(false)` or a dependent
`explicit(...)` specifier was already written. Apply the same
`ExplicitSpecifier` inspection to conversion operators so deliberately
implicit C++20 `explicit(false)` and dependent `explicit(...)`
conversion operators are not diagnosed.
Assisted-by: Gemini
[Attributor] Merge the scopes of potential values with a `|=`
`recurseForValue` merges the scopes of a value with `+=`. If a value appears
more than once in the values of one scope, the sum is not a valid scope.
This PR was assisted by AI but I reviewed all the changes.
[RegAllocFast] Keep inline asm uses off a tied physical def's register (#246907)
```
%1:gr32 = MOV32ri 0
INLINEASM ..., def %2, implicit-def $ecx, %0(tied-def 3), %0(tied-def 5), %1
$edx = COPY %0
```
%0 is used after the asm, so both tied uses are copies of it. %1 is
assigned $ecx, and the copy into $ecx overwrites it:
```
renamable $ecx = MOV32ri 0
$eax = COPY $edx
$ecx = COPY $edx
INLINEASM ..., killed renamable $ecx
```
lowerTiedUse frees the tied def's register after inserting the copy. A
[4 lines not shown]
[Sparc][MC] Don't report "unexpected token" after an operand error (#245208)
When an operand failed to parse, parseInstruction always reported
"unexpected token", even when the operand parser had already reported a
more specific error. So most operand errors were followed by a second,
less useful one, e.g.:
```
error: invalid register name
error: unexpected token
```
Make the operand parsers follow the ParseStatus convention, where
Failure means an error was reported and NoMatch means nothing was
consumed and no error was reported, and only report "unexpected token"
for NoMatch:
- parseSparcAsmOperand returns NoMatch for tokens it does not handle,
and Failure only after an error.
[19 lines not shown]
[msan][test] Show masked_store with zero mask incorrectly sets origin (#246161)
handleMaskedStore() unconditionally sets the origin, even in cases where
the mask ends up being zero (as evaluated at compile-time or runtime)
i.e., no bytes were stored. This PR adds a regression test case and a
TODO in the MSan instrumentation pass.
---------
Co-authored-by: Vitaly Buka <vitalybuka at google.com>
[ASan][test] Use %run in dlopen-mixed-c-cxx.c (#246215)
The test ran its binary directly, so it failed on targets that need an
emulator or a remote device.
Assisted-by: Claude Code