[flang-rt] Fixes EXECUTE_COMMAND_LINE() status management and double buffering (#184285)
EXECUTE_COMMAND_LINE() without CMDSTAT initiated termination in runtime
if the command returned non-zero status code. For example,
EXECUTE_COMMAND_LINE('false') on Linux would cause "fatal Fortran
runtime error... : Command line execution failed with exit code: 1."
This is too strict: EXECUTE_COMMAND_LINE() successfully called 'false',
it's just 'false' happened to return non-zero status code. ifx and
gfortran don't initiate termination in such case. Changed
EXECUTE_COMMAND_LINE() implementation to behave in similar fashion.
Also during testing discovered that when the output of the program that
uses EXECUTE_COMMAND_LINE(... WAIT=.false.) is piped to a file, the
resulting file has duplicated output lines. This was because fork()
command also ends up duplicating parent's buffered output to the child.
Added flush of all units and C stdio before calling fork().
Modify semantic check for affinity clause
- Add CheckLastPartRef
- Add CheckArraySection
- Add comment why we still need check for substring even if
CheckArraySection is called
Modify semantic check for affinity clause
- Add CheckLastPartRef
- Add CheckArraySection
- Add comment why we still need check for substring even if
CheckArraySection is called
[MLIR][Python] Move operation/dialect name retrieving as a util function (#184605)
We have a common pattern that retrieve an operation name or dialect name
from a `type` or `str` in the rewrite nanobind module, so better to make
it a common util function.
---------
Co-authored-by: Rolf Morel <rolfmorel at gmail.com>
[MLIR][Python] Add `replace` parameter to `Dialect.load` (#184604)
In this PR, `replace` keyword parameter is added to `Dialect.load(..)`
in `mlir.dialects.ext`. It's to replace existing registered
operations/types/attrs.
[mlir][spirv] Fix crash in FuncOpVectorUnroll for dynamic-shaped tensor args (#184626)
FuncOpVectorUnroll::matchAndRewrite iterates over all function arguments
and creates a zero-constant placeholder for any non-vector argument via
rewriter.getZeroAttr(type). For dynamically-shaped tensor types such as
tensor<?x2xi8>, getZeroAttr ultimately calls
DenseIntOrFPElementsAttr::getRaw which asserts that the type has a
static shape.
Add an early pre-check that returns failure() for any non-vector
argument with a dynamically-shaped type. This must be done before any IR
modifications are made, since returning failure() after inlining the
function body would leave the IR in an inconsistent state.
Fixes #148369
devel/py-cloup: New port
Cloup — originally from “Click + option groups” — enriches Click with
several features that make it more expressive and configurable.
[mlir] Add cross-context checks to the IR verifier (#184627)
Detect IR where result types, operand types, or discardable attribute
values come from a different MLIRContext than the operation itself.
Mixing contexts is a latent use-after-free hazard when one context is
destroyed before the other; the verifier now reports a clear error
instead of silently allowing the invalid IR through.
Three new unit tests in MLIRIRTests cover each scenario.
Fix #61569