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

Commit

Permalink
[spirv] Mark control flow ops as InFunctionScope
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 277373473
  • Loading branch information
antiagainst authored and tensorflower-gardener committed Oct 29, 2019
1 parent 44e7227 commit 2bd4e07
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ include "mlir/Analysis/CallInterfaces.td"

// -----

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

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

// -----

def SPV_BranchConditionalOp : SPV_Op<"BranchConditional", [Terminator]> {
def SPV_BranchConditionalOp : SPV_Op<"BranchConditional",
[InFunctionScope, Terminator]> {
let summary = [{
If Condition is true, branch to true block, otherwise branch to false
block.
Expand Down Expand Up @@ -265,7 +266,7 @@ def SPV_FunctionCallOp : SPV_Op<"FunctionCall", [

// -----

def SPV_LoopOp : SPV_Op<"loop"> {
def SPV_LoopOp : SPV_Op<"loop", [InFunctionScope]> {
let summary = "Define a structured loop.";

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

def SPV_SelectionOp : SPV_Op<"selection"> {
def SPV_SelectionOp : SPV_Op<"selection", [InFunctionScope]> {
let summary = "Define a structured selection.";

let description = [{
Expand Down

0 comments on commit 2bd4e07

Please sign in to comment.