Skip to content

Commit

Permalink
Mark recursively speculatable ops as such (openxla#2175)
Browse files Browse the repository at this point in the history
This includes the regioned ops case, if and while.
  • Loading branch information
mlevesquedion authored Apr 8, 2024
1 parent e2ad824 commit 5e03518
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions stablehlo/dialect/StablehloOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,7 @@ def StableHLO_AfterAllOp : StableHLO_Op<"after_all", [Pure,
// conditional use of kConditional HLO.
def StableHLO_IfOp: StableHLO_Op<"if", [
RecursiveMemoryEffects,
RecursivelySpeculatable,
SingleBlockImplicitTerminator<"ReturnOp">,
DeclareOpInterfaceMethods<InferTypeOpInterface>]> {
let summary = "If operation";
Expand Down Expand Up @@ -1230,6 +1231,7 @@ def StableHLO_IfOp: StableHLO_Op<"if", [
// conditional use of kConditional HLO.
def StableHLO_CaseOp: StableHLO_Op<"case", [
RecursiveMemoryEffects,
RecursivelySpeculatable,
SingleBlockImplicitTerminator<"ReturnOp">,
DeclareOpInterfaceMethods<InferTypeOpInterface> /*case_c4*/
]> {
Expand Down Expand Up @@ -1263,6 +1265,7 @@ def StableHLO_CaseOp: StableHLO_Op<"case", [

def StableHLO_WhileOp: StableHLO_Op<"while", [
RecursiveMemoryEffects,
RecursivelySpeculatable,
SingleBlockImplicitTerminator<"ReturnOp">,
DeclareOpInterfaceMethods<InferTypeOpInterface> /*while_c3*/,
OpAsmOpInterface
Expand Down

0 comments on commit 5e03518

Please sign in to comment.