llvm-project/mlir/lib
Alex Zinenko d4a53f3bfa [mlir] call target materialization more in dialect conversion
During dialect conversion, target materialization is triggered to create
cast-like operations when a type mismatch occurs between the value that
replaces a rewritten operation and the type that another operations expects as
operands processed by the type conversion. First, a dummy cast is inserted to
make sure the pattern application can proceed. The decision to trigger the
user-provided materialization hook is taken later based on the result of the
dummy cast having uses. However, it only has uses if other patterns constructed
new operations using the casted value as operand. If existing (legal)
operations use the replaced value, they may have not been updated to use the
casted value yet. The conversion infra would then delete the dummy cast first,
and then would replace the uses with now-invalid (null in the bast case) value.
When deciding whether to trigger cast materialization, check for liveness the
uses not only of the casted value, but also of all the values that it replaces.

This was discovered in the finalizing bufferize pass that cleans up
mutually-cancelling casts without touching other operations. It is not
impossible that there are other scenarios where the dialect converison infra
could produce invalid operand uses because of dummy casts erased too eagerly.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D119937
2022-02-17 10:13:23 +01:00
..
Analysis [MLIR][Presburger] normalizeDivisionByGCD: fix bug when constant term is negative 2022-02-11 17:02:52 +05:30
Bindings/Python [mlir][python] Directly implement sequence protocol on Sliceable. 2022-02-14 09:45:17 -08:00
CAPI [mlir][linalg] Add attributes to region builder (NFC). 2022-02-14 13:14:14 +00:00
Conversion [mlir][MemRef] Lower memref.copy with an offset to memcpy 2022-02-16 17:18:31 +01:00
Dialect [mlir][gpu] Split ops sinking from gpu-kernel-outlining pass into separate pass 2022-02-17 10:34:20 +03:00
ExecutionEngine
IR [mlir] Expose printer flags in AsmState 2022-02-15 17:27:45 -08:00
Interfaces
Parser
Pass
Reducer
Rewrite
Support
TableGen [mlir][ods] Allow type attribute/operand for 0 result ops prefixed 2022-02-15 12:20:07 -08:00
Target [OpenMP][IRBuilder] Change the default constructor for OpenMPIRBuilder::LocationDescription 2022-02-15 00:40:34 +05:30
Tools
Transforms [mlir] call target materialization more in dialect conversion 2022-02-17 10:13:23 +01:00
Translation
CMakeLists.txt