Skip to content

Commit 125466a

Browse files
committed
[mlir][emitc] Add support of pointer wide types
1 parent 1188105 commit 125466a

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

mlir/include/mlir/Dialect/EmitC/IR/EmitC.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ bool isSupportedFloatType(mlir::Type type);
4747
/// Determines whether \p type is a emitc.size_t/ssize_t type.
4848
bool isPointerWideType(mlir::Type type);
4949

50-
/// Determines whether \p type is a valid integer, index or opaque type for
51-
/// SwitchOp.
52-
bool isSwitchOperandType(Type type);
53-
5450
} // namespace emitc
5551
} // namespace mlir
5652

mlir/include/mlir/Dialect/EmitC/IR/EmitC.td

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ def CExpression : NativeOpTrait<"emitc::CExpression">;
5454
def IntegerIndexOrOpaqueType : Type<CPred<"emitc::isIntegerIndexOrOpaqueType($_self)">,
5555
"integer, index or opaque type supported by EmitC">;
5656
def FloatIntegerIndexOrOpaqueType : AnyTypeOf<[EmitCFloatType, IntegerIndexOrOpaqueType]>;
57-
def SwitchOperandType : Type<CPred<"emitc::isSwitchOperandType($_self)">,
58-
"integer type for switch operation">;
5957

6058
def EmitC_AddOp : EmitC_BinaryOp<"add", [CExpression]> {
6159
let summary = "Addition operation";
@@ -1361,7 +1359,7 @@ def EmitC_SwitchOp : EmitC_Op<"switch", [RecursiveMemoryEffects,
13611359
```
13621360
}];
13631361

1364-
let arguments = (ins SwitchOperandType:$arg, DenseI64ArrayAttr:$cases);
1362+
let arguments = (ins IntegerIndexOrOpaqueType:$arg, DenseI64ArrayAttr:$cases);
13651363
let results = (outs);
13661364
let regions = (region SizedRegion<1>:$defaultRegion,
13671365
VariadicRegion<SizedRegion<1>>:$caseRegions);

mlir/lib/Dialect/EmitC/IR/EmitC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,7 @@ static LogicalResult verifyRegion(emitc::SwitchOp op, Region &region,
12111211
}
12121212

12131213
LogicalResult emitc::SwitchOp::verify() {
1214-
if (!isSwitchOperandType(getArg().getType()))
1214+
if (!isIntegerIndexOrOpaqueType(getArg().getType()))
12151215
return emitOpError("unsupported type ") << getArg().getType();
12161216

12171217
if (getCases().size() != getCaseRegions().size()) {

0 commit comments

Comments
 (0)