[clang] [CIR] Upstream support for FlattenCFG switch and SwitchFlatOp (PR #139154)
via cfe-commits
cfe-commits at lists.llvm.org
Tue May 13 14:23:20 PDT 2025
================
@@ -971,6 +971,52 @@ def SwitchOp : CIR_Op<"switch",
}];
}
+//===----------------------------------------------------------------------===//
+// SwitchFlatOp
+//===----------------------------------------------------------------------===//
+
+def SwitchFlatOp : CIR_Op<"switch.flat", [AttrSizedOperandSegments,
+ Terminator]> {
+
+ let description = [{
+ The `cir.switch.flat` operation is a region-less and simplified
+ version of the `cir.switch`.
+ It's representation is closer to LLVM IR dialect
+ than the C/C++ language feature.
+ }];
+
+ let arguments = (ins
+ CIR_IntType:$condition,
+ Variadic<AnyType>:$defaultOperands,
+ VariadicOfVariadic<AnyType, "case_operand_segments">:$caseOperands,
+ ArrayAttr:$case_values,
----------------
Andres-Salamanca wrote:
I'm going to leave it as caseValues
https://github.com/llvm/llvm-project/pull/139154
More information about the cfe-commits
mailing list