Skip to content

[Utils] Add ability to configure git-llvm-push from .gitconfig - #60

Merged
boomanaiden154 merged 510 commits into
mainfrom
users/boomanaiden154/git-llvm-push-git-config-1
Mar 18, 2026
Merged

[Utils] Add ability to configure git-llvm-push from .gitconfig#60
boomanaiden154 merged 510 commits into
mainfrom
users/boomanaiden154/git-llvm-push-git-config-1

Conversation

@boomanaiden154

Copy link
Copy Markdown
Owner

This lets someone set git config options at whatever scope (per-repo,
global, etc.) for the options that they care about. This provides
similar functionality to just wrapping the script in a shell script with
one's desired options without the need to do that.

We need to be careful about how when we get the flags and how to execute
the git command to get the flags. For now, we do this before normal
argument parsing and fail silently to avoid printing output if someone
passes something like --quiet through the git config. This means options
like --verbose and --dry-run don't work for this specific command, but I
think that is a reasonable tradeoff.

ldionne and others added 30 commits March 17, 2026 12:15
This is a small refactor of how DeducedType and it's derived types are
represented.

The different deduction kinds are spelled out in an enum, and how this
is tracked is simplified, to allow easier profiling.

How these types are constructed and canonicalized is also brought more
in line with how it works for the other types.

This fixes a crash reported here:
llvm#167513 (comment)
This does a few changes that are hard to separate from each other:
* Consider forming minnum/maxnum from setcc+select non-profitable. X86
  has instructions specifically for the setcc+select pattern. (Without
  this it's hard to get good coverage on this code path.)
* Reduce duplication in the code for forming FMIN/FMAX, by using
  predicate inversion (to make setcc and select operand order match) and
  predicate invswap (to canonicalize to ordered predicates). This leaves
  us with just ordered and NaN-less predicates.
* For non-strict non-less predicates, convert them to strict ones via
  invswap (i.e. swapping the operands of both the setcc and select).
  Previously this just treated them the same as strict predicates, but I
  believe that's incorrect in terms of signed zero handling.
Adds a newPM pass for AArch64ConditionOptimizer.

- Refactors base logic into an Impl class
- Renames old pass with the "Legacy" suffix
- Adds the new pass manager pass using refactored logic
- Updates tests

Context and motivation in
https://llvm.org/docs/NewPassManager.html#status-of-the-new-and-legacy-pass-managers
Use a class instead of an alias, so that CycleInfo can be
forward-declared.

We can't do the same for Cycle without further changes (a LoopInfo like
CRTP scheme).
Occasionally wait_for_file_on_target will time out on the Green Dragon
bots and we're not sure why. I'm adding this logging in an attempt to
get more clues as to what's happening when it fails.
…#187037)

AMDGPUTargetMachine also had a static method which did the same thing.
Remove it so that we have a single source of truth.
…for non-descriptor dummies (llvm#186894)

When ignore_tkr(c) is set and the actual argument is an allocatable or
pointer (stored as a descriptor), the lowering code was unconditionally
returning the descriptor pointer as-is, regardless of whether the dummy
argument expects a descriptor. For bind(c) interfaces with assumed-size
dummies (e.g., cuFFT), the dummy expects a raw pointer, not a
descriptor. Passing the descriptor caused the C function to receive the
wrong address, leading to silent data corruption and invalid descriptor
crashes at deallocation.

The fix adds a check that the early return for ignore_tkr(c) only
applies when the dummy type is itself a descriptor type. When the dummy
expects a base address, the normal path is taken, which correctly
extracts the base address from the descriptor via fir.box_addr.
The variable `matches` may be assigned the address of block-scope
`local_matches`, which is defined in a scope strictly smaller than the
scope of `matches`. Towards the end of the function, after
`loacl_matches` has been destroyed, `matches` is accessed, possibly
triggering a user-after-free.
Use `math.round` in lowering of `anint` so we can use passes like
`MathToNVVM` to target device code differently.
…) (llvm#186833)

This patch adds support for `float8_e3m4` and `float8_e4m3` in
`np_to_memref.py` by adding the appropriate ctypes structures.
Additionally changes minimum numpy version to 2.1.0 and uses a single
ml_dtypes version of 0.5.0.
…InputsDead (llvm#186325)

Optimize MakeRegionBranchOpSuccessorInputsDead patterns in
`ControlFlowInterfaces.cpp`:

- Add early exit to `computeReachableValuesFromSuccessorInput` when the
caller only needs to know if there is exactly one reachable value,
avoiding unnecessary traversal.

Assisted-by: Claude Code

Co-authored-by: Yang Bai <yangb@nvidia.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rand types (llvm#186550)

This patch disables vectorizing Cmps with different operand types
because we can't form a legal vector.
This used to cause an assertion check crash once we attempted to pack
the bundle formed by Cmp's operands.
…ice array descriptors (llvm#186945)

When an allocatable CUDA Fortran device array is privatized in an OpenMP
region, the null descriptor created in the omp.private init region was
missing the allocator_idx attribute. This caused a subsequent allocate()
inside the parallel region to call malloc instead of cudaMalloc, because
the runtime's Descriptor::Allocate() reads allocator_idx from the
descriptor to select the allocator. On some systems it caused
cudaErrorInvalidValue crashes.

This patch sets allocator_idx = 2 (device allocator) on the null
fir.embox in handleNullAllocatable() when the symbol has a CUDA device
attribute, so that the Fortran runtime correctly calls cudaMalloc for
the privatized array.
…shes (llvm#186145)

When the bytecode type callback (test-kind=2) calls iface->readType()
for every builtin type, complex types like MemRefType could crash
because the generated reading code used get<T>() which asserts on
invalid parameters, rather than getChecked<T>() which returns null
gracefully.

This change:
- Adds a getChecked<T>() free function helper in
BytecodeImplementation.h that calls T::getChecked(emitError, params)
(no-context form) when a specific override exists, otherwise falls back
to get<T>(). The with-context second branch is intentionally omitted to
avoid instantiating StorageUserBase::getChecked<Args> for types that
only inherit the base template (e.g. ArrayAttr), which would require
complete storage types unavailable in the bytecode reading TU.
- Updates BytecodeBase.td default cBuilder for
DialectAttribute/DialectType to use getChecked<> instead of get<>.
- Updates all custom cBuilder strings in BuiltinDialectBytecode.td.
- Updates the no-args codegen case in BytecodeDialectGen.cpp.
- Adds a regression test in bytecode_callback_with_custom_type.mlir.

Fixes llvm#128308

Assisted-by: Claude Code
…ources (llvm#187063)

Allows us to use getMaskNode to canonicalize predicate masks in big shift lowering
…186653)

Replace the monolithic cir.binop.overflow operation and its
BinOpOverflowKind enum with three individual operations:
cir.add.overflow, cir.sub.overflow, and cir.mul.overflow.

This follows the same pattern used when BinOp and UnaryOp were
previously split into per-operation ops (cir.add, cir.sub, etc.),
eliminating enum dispatch and enabling per-op traits like Commutative.
This MR removes a hard-coded compute number in an MLIR test. This will
allow the test to not need to be updated in the future. The default
value will come from `NVVMOps.td`.
Allow `--function-order` to be combined with `--reorder-functions`
algorithms. Functions listed in the order file are pinned first
(indices 0..N-1), then the selected algorithm orders remaining
functions starting at index N.
… rules (llvm#186974)

Update `mlir/test/Target/SPIRV/struct.mlir` so it remains valid under
current SPIR-V validator checks in Logical addressing mode.

The recursive struct cases were emitting pointer-allocating globals in
storage classes rejected by `spirv-val`. Adjust those globals to
`Private` while keeping recursive member pointers in `StorageBuffer`,
and update the expected roundtrip types accordingly.

Also add the missing variable-pointer requirements to the module VCE:
- capability: `VariablePointers`
- extension: `SPV_KHR_variable_pointers`

Signed-off-by: Davide Grohmann <davide.grohmann@arm.com>
…)" (llvm#187079)

Reverts llvm#187025

Fails on openmp bot:
https://lab.llvm.org/buildbot/#/builders/10/builds/24743
('INT64_MIN' macro redefined when used Clang-provided <stdint.h> is
used)
fails on RISC-V-32 bot:
https://lab.llvm.org/buildbot/#/builders/196/builds/17067
due to MPFRNumber constructor not picking the right overload for
uint32_t argument.
)

This patch initiates the refactoring of Linux syscalls as described in
the RFC (https://discourse.llvm.org/t/rfc-linux-syscall-cleanup/87248/).

It introduces a new infrastructure in
`src/__support/OSUtil/linux/syscall_wrappers/` to house header-only
syscall wrappers. These wrappers utilize `ErrorOr` to provide a
consistent, type-safe interface for error handling across the library,
standardizing how syscall return values are converted into
errno-compatible Error objects.

Summary of changes:
- Created the `syscall_wrappers` directory and added `close.h`,
`read.h`, `write.h`, and `open.h`.
- Moved the existing `getrandom.h` into the new `syscall_wrappers`
directory and updated its callers (including HashTable/randomness.h).
- Refactored core entrypoints (`close`, `read`, `write`, `open`) to use
the new wrappers, removing direct `syscall_impl` logic and manual errno
setting.
- Updated `shm_open.cpp` to use the new `open` wrapper.
- Cleaned up `OSUtil/linux/fcntl.cpp` by removing redundant internal
implementations of `open` and `close`.
- Added a developer guide in `docs/dev/syscall_wrapper_refactor.rst`
outlining the established pattern for future migrations.

---------

Co-authored-by: Michael Jones <michaelrj@google.com>
…185772)

The `__ob_trap` type specifier can be used to trap (or warn with sanitizers) when overflow or truncation occurs on the specified type.

There was a gap in coverage for this with the `-fsanitize=implicit-integer-sign-change` sanitizer. Fix this by carrying around `__ob_trap` information through `EmitIntegerSignChange()` which allows us to properly trap or warn.
Add `spirv.GroupNonUniformBroadcastFirst` op and tests.
…m#186907)

1. There was duplicate code between the integer range analysis's
handling of static dimension size information (ex. gpu.known_block_dim
attributes) and the handling during the lowering of those operations.
The code from integer range analysis was given a dialect-wide entry
point (and had its types fixed to be more accurate), which the lowering
templates now call.
2. The templated lowering for block/grid/cluster_dim now produces
precise ranges (indicating the constant value) where one is known, and
the lowerings in rocdl (including those for subgroup_id) have been fixed
appropriately.
3. While I was here, the gpu.dimension enum has been moved to GPUBase so
it lives next to the other enums.
4. The pattern that expands subgroup_id operations now adds any thread
dimension bounds it finds in context.

(Claude was used for an initial round of review, I did the main coding
myself.)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
kkwli and others added 26 commits March 18, 2026 15:51
…llvm#187325)

Regenerate checks after two recent commits that caused extra stuff to be
added at the end of assembly lines, so the existing checks did not fail.

- llvm#179414 added "nv" to loads and stores on GFX1250.
- llvm#185774 added "msbs" comments on setreg instructions.
Add tests showing incorrect poison propagation from
llvm#187061.
…ive7 model (llvm#187331)

The integer division and remainder instructions on a 32-bit core that
uses SiFive7 scheduling model should have the same latency and
throughput as its word counterparts on a 64-bit SiFive7 core.

This patch fixes those scheduling entries by adding a new SchedPred that
predicates on `Feature64Bit` to toggle the SchedVariant that is attached
on the affected integer division / remainder instructions.
Previously, the MLIR's python binding `smt.export_smtlib(...)` always
emit `(reset)` to the end of smtlib string as a solver terminator.
This PR added an option to suppress this trailing, as downstream users
like python z3 module don't need it.
…est asserts like `ASSERT_TRUE` and `ASSERT_FALSE` (llvm#186363)

Resolves  llvm#181737

Addresses false positives reported in
llvm#181737 .

This PR is heavily inspired by
llvm#170947 .

Many thanks to @fmayer for the prior work.

---------

Co-authored-by: EugeneZelenko <eugene.zelenko@gmail.com>
masked_cond is used to combine early-exit conditions with masks from
predicate. The early-exit condition should only be evaluated if the mask
is true. Emit the mask first, to avoid incorrect poison propagation.

Fixes llvm#187061.
…FC. (llvm#187276)

This is derived from MachineFunctionInfo not MachineFunction.
truncf op converts 16 bit floats to 8 bit or 4 bit floats.
mma_mx op does cooperative matrix multiply accumulate on
8 or 4 bit float type with 8bit scale value.
…lvm#187369)

If a loop required a cleanup scope in the condition or step region of
the loop, we crashed during CFG flattening because the flattening of the
cleanup scope created multiple blocks in the region, but we were
assuming there would only be one block.

This change updates the CFG flattening code to look for the
cir.condition or cir.yield operation in the last block of the region.
isExtractContiguousSlice:
- Check if mask size is not greater than the vector size of the operand.
- Check if mask values do not exceed vector size. 

HandleVectorExtractPattern:
- Narrow the scope of matching to, 
  - Source shuffle doing contiguous extract
  - Source shuffle with at least the same mask size.
Introduce `swmmac-gfx1200-insts` and `swmmac-gfx1250-insts`
…nconditionally (llvm#186844)

For interoperability between CUDA Fortran and OpenACC.
…lvm#186466)

arith.maxsi/maxui/minsi/minui are more concise than cmp+select
and probably allow more folding, so we should use it in Flang lowering.
The `pick` op requires an unsigned integer index. Use the `u` suffix
when generating `pick` operations in the Python->formatter-bytecode
compiler.
…a READ command. (llvm#176959)

NOTE: This is a new pull request, as the prior didn't have labels
properly applied.

If a bad subscript is provided in a namelisted record, the
HandleSubscripts() routine can read off into infinity. This patch
ensures that a read will not go beyond the rank of the expected
variable.

The failure will then be captured in the return status (IOSTAT) of the
READ.

The small test demonstrates the failure before and after the fix.

---------

Co-authored-by: Kevin Wyatt <kwyatt@hpe.com>
…Gs (llvm#186808)

Bail out early if the visiting each reachable basic block once would
have exceeded the MaxBlockVisits limit. If that is the case, then
actually visiting and doing the dataflow analysis would hit the limit,
but we would have wasted a lot of time.

Another possibility is that we run out of memory (OOM) and the process
crashes. We've seen example of CFGs with # of blocks that are 2-8x the
visit limit. Those examples also have lots of `Locs`, which we track in
MapVectors for each BB. Since the maps do not share memory across BBs,
this leads to non-linear memory usage and OOMing before hitting the max
visit limit. With this, we can avoid OOMing, and at least get some
results for the other CFGs in the TU, instead of losing all results from
the process crashing.
…186980)

This testcase fails on MinGW targets, because when compiling the main()
function, it gets an implicit call to __main(), which is missing in this
context.

See 4c642b6 and
9b282af for existing precedent for such
XFAILs.
…m#187385)

Summary:
Integrated a series of quick documentation cleanups for LLVM-libc. This
update focuses on de-duplicating core conventions (naming and
namespaces) across multiple developer and contribution guides, and
addresses empty platform stubs for UEFI.

Changes:

* libc/docs/contributing.rst: Removed duplicated code style rules and
provided a link to dev/code_style.rst.
* libc/docs/dev/clang_tidy_checks.rst: Removed redundant namespace
explanations and linked to dev/code_style.rst.
* libc/docs/dev/implementation_standard.rst: Removed repetitive notes
about LIBC_NAMESPACE_DECL and linked to the authoritative reference.
* libc/docs/uefi/support.rst & libc/docs/uefi/using.rst: Added
early-stage bring-up warnings and pointed to the config directory for
the source of truth.
Currently, SLP vectorizer do not care about loops and their trip count.
It may lead to inefficient vectorization in some cases. Patch adds loop
nest-aware tree building and cost estimation.
When it comes to tree building, it now checks that tree do not span
across different loop nests. The nodes from other loop nests are
immediate buildvector nodes.
The cost model adds the knowledge about loop trip count. If it is
unknown, the default value is used, controlled by the
-slp-cost-loop-min-trip-count=<value> option. The cost of the vector
nodes in the loop is multiplied by the number of iteration (trip count),
because each vector node will be executed the trip count number of
times. This allows better cost estimation.

Original Reviewers:
jdenny-ornl, vporpo, hiraditya, RKSimon

Original PR: llvm#150450

Recommit after revert in c7bd306 and in 4e500bd

Reviewers: 

Pull Request: llvm#187391
When a reference to a generic procedure fails, the compiler explains why
each of the generic's specific procedures failed to match the actual
arguments. This code had a subtle bug: adjustments to the actual
arguments made for interface checking for earlier specific procedures
would persist and affect the checks for later specific procedures.
Adds a port for AArch64ExpandPseudo to NewPM.

- Refactored lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp to extract
base logic as Impl
- Renamed existing pass with "Legacy" suffix and updated references
- Added NewPM pass AArch64ExpandPseudoPass
- Updated tests

Following tests mention this pass but weren't migrated because they need
a full codegen pipeline which doesn't exist yet.

```
  LLVM :: CodeGen/AArch64/GlobalISel/arm64-pcsections.ll
  LLVM :: CodeGen/AArch64/addg_subg.mir
  LLVM :: CodeGen/AArch64/rvmarker-pseudo-expansion-and-outlining.mir
  LLVM :: CodeGen/AArch64/spillfill-sve.mir
  LLVM :: CodeGen/AArch64/subreg_to_reg_coalescing_issue.mir
```
Add `--sort` to emit remarks in sorted order and `--dedupe` to
deduplicate identical remarks. Only if these options are requested,
remarks need to be buffered into a sorted map before emission.

Pull Request: llvm#187338
This enables automatically getting the token from the gh CLI tool which
was a requested feature.

Reviewers: petrhosek, ilovepi

Reviewed By: petrhosek, ilovepi

Pull Request: llvm#186695
This lets someone set git config options at whatever scope (per-repo,
global, etc.) for the options that they care about. This provides
similar functionality to just wrapping the script in a shell script with
one's desired options without the need to do that.

We need to be careful about how when we get the flags and how to execute
the git command to get the flags. For now, we do this before normal
argument parsing and fail silently to avoid printing output if someone
passes something like --quiet through the git config. This means options
like --verbose and --dry-run don't work for this specific command, but I
think that is a reasonable tradeoff.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.