MarisaKirisame commented on a change in pull request #6238:
URL: https://github.com/apache/incubator-tvm/pull/6238#discussion_r479984425
##########
File path: python/tvm/tir/transform/transform.py
##########
@@ -500,11 +500,29 @@ def VerifyMemory():
"""
return _ffi_api.VerifyMemory()
-def HoistIfThenElse():
+def HoistIfThenElse(variant=None):
"""Hoist loop-invariant IfThenElse nodes to outside the elligible loops.
+
+ Parameters
+ ----------
+ variant : str, optional
+ The variant of the pass.
+ variant can have any one of following values ["basic", None(Default)].
+
+ The basic variant supports basic hoisting scenarios where it exepects
+ the For & If Nodes are in place consecutively and does not involve
+ global scope variables or more advanced scenarios.
+
+ Default variant supports all hoisting scenarios,i.e., {"Basic" +
"Advanced"}
+ supported with control with PassContext configs like below:
+
+ config={"tir.HoistIfThenElse": {"support_block_scope_hosting":
True}}
+
Returns
-------
fpass : tvm.transform.Pass
The result pass
"""
+ if variant == "basic":
+ return _ffi_api.HoistIfThenElseBasic()
return _ffi_api.HoistIfThenElse()
Review comment:
please dont fall back. check that the string is None before calling this.
##########
File path: python/tvm/tir/transform/transform.py
##########
@@ -500,11 +500,29 @@ def VerifyMemory():
"""
return _ffi_api.VerifyMemory()
-def HoistIfThenElse():
+def HoistIfThenElse(variant=None):
"""Hoist loop-invariant IfThenElse nodes to outside the elligible loops.
+
+ Parameters
+ ----------
+ variant : str, optional
Review comment:
Optional[String]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]