Files
clang-p2996/mlir/test/Target/Cpp/conditional.mlir
Marius Brehler 19266ca389 [mlir][EmitC] Add an emitc.conditional operator (#84883)
This adds an `emitc.conditional` operation for the ternary conditional
operator. Furthermore, this adds a converion from `arith.select` to the
new op.
2024-03-12 11:27:26 +01:00

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:[^ ]*]];