This effectively rewrites Ch.2 to introduce dialects, operations, and registration instead of deferring to Ch.3. This allows for introducing the best practices up front(using ODS, registering operations, etc.), and limits the opaque API to the chapter document instead of the code. PiperOrigin-RevId: 274724289
10 lines
263 B
MLIR
10 lines
263 B
MLIR
// RUN: not toyc-ch2 %s -emit=mlir 2>&1
|
|
|
|
// The following IR is not "valid":
|
|
// - toy.print should not return a value.
|
|
// - toy.print should take an argument.
|
|
// - There should be a block terminator.
|
|
func @main() {
|
|
%0 = "toy.print"() : () -> tensor<2x3xf64>
|
|
}
|