This adds an `emitc.conditional` operation for the ternary conditional operator. Furthermore, this adds a converion from `arith.select` to the new op.
10 lines
286 B
MLIR
10 lines
286 B
MLIR
// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s
|
|
|
|
func.func @cond(%cond: i1, %arg0: i32, %arg1: i32) -> () {
|
|
%0 = emitc.conditional %cond, %arg0, %arg1 : i32
|
|
return
|
|
}
|
|
|
|
// CHECK-LABEL: void cond
|
|
// CHECK-NEXT: int32_t [[V3:[^ ]*]] = [[V0:[^ ]*]] ? [[V1:[^ ]*]] : [[V2:[^ ]*]];
|