[Mlir-commits] [mlir] [mlir][emitc] Add 'emitc.switch' op to the dialect (PR #102331)
Andrey Timonin
llvmlistbot at llvm.org
Fri Aug 9 03:10:02 PDT 2024
================
@@ -131,6 +131,12 @@ bool mlir::emitc::isPointerWideType(Type type) {
type);
}
+bool mlir::emitc::isSwitchOperandType(Type type) {
+ auto intType = llvm::dyn_cast<IntegerType>(type);
----------------
EtoAndruwa wrote:
> The emitc IR is mostly a syntactic representation of the C++ code. So I'd think that emitc.switch should allow all integral types as condition.
To be precise, we want to allow all integral types, opaque and index? Cases for the switch must always be integers (arg will be implicitly casted to i64). And there is no need to add the logic for parsing something like this: `case true:`, `case ENUM::...:`. Am I right?
https://github.com/llvm/llvm-project/pull/102331
More information about the Mlir-commits
mailing list