Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Commit 2bd4e07

Browse files
antiagainsttensorflower-gardener
authored andcommitted
[spirv] Mark control flow ops as InFunctionScope
PiperOrigin-RevId: 277373473
1 parent 44e7227 commit 2bd4e07

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ include "mlir/Analysis/CallInterfaces.td"
3636

3737
// -----
3838

39-
def SPV_BranchOp : SPV_Op<"Branch", [Terminator]> {
39+
def SPV_BranchOp : SPV_Op<"Branch", [InFunctionScope, Terminator]> {
4040
let summary = "Unconditional branch to target block.";
4141

4242
let description = [{
@@ -90,7 +90,8 @@ def SPV_BranchOp : SPV_Op<"Branch", [Terminator]> {
9090

9191
// -----
9292

93-
def SPV_BranchConditionalOp : SPV_Op<"BranchConditional", [Terminator]> {
93+
def SPV_BranchConditionalOp : SPV_Op<"BranchConditional",
94+
[InFunctionScope, Terminator]> {
9495
let summary = [{
9596
If Condition is true, branch to true block, otherwise branch to false
9697
block.
@@ -265,7 +266,7 @@ def SPV_FunctionCallOp : SPV_Op<"FunctionCall", [
265266

266267
// -----
267268

268-
def SPV_LoopOp : SPV_Op<"loop"> {
269+
def SPV_LoopOp : SPV_Op<"loop", [InFunctionScope]> {
269270
let summary = "Define a structured loop.";
270271

271272
let description = [{
@@ -402,7 +403,7 @@ def SPV_ReturnValueOp : SPV_Op<"ReturnValue", [InFunctionScope, Terminator]> {
402403
let results = (outs);
403404
}
404405

405-
def SPV_SelectionOp : SPV_Op<"selection"> {
406+
def SPV_SelectionOp : SPV_Op<"selection", [InFunctionScope]> {
406407
let summary = "Define a structured selection.";
407408

408409
let description = [{

0 commit comments

Comments
 (0)