}
};
-// Allow the true region of an if to assume the condition is true
-// and vice versa. For example:
-//
-// scf.if %cmp {
-// print(%cmp)
-// }
-//
-// becomes
-//
-// scf.if %cmp {
-// print(true)
-// }
-//
+/// Allow the true region of an if to assume the condition is true
+/// and vice versa. For example:
+///
+/// scf.if %cmp {
+/// print(%cmp)
+/// }
+///
+/// becomes
+///
+/// scf.if %cmp {
+/// print(true)
+/// }
+///
struct ConditionPropagation : public OpRewritePattern<IfOp> {
using OpRewritePattern<IfOp>::OpRewritePattern;
/// print(%cmp)
///
/// Additionally if both branches yield the same value, replace all uses
-/// of the result with the yielded value
+/// of the result with the yielded value.
///
/// %res:2 = scf.if %cmp {
/// yield something(), %arg1
/// } else {
/// yield something2()
/// }
-// print(%arg1)
+/// print(%arg1)
+///
struct ReplaceIfYieldWithConditionOrValue : public OpRewritePattern<IfOp> {
using OpRewritePattern<IfOp>::OpRewritePattern;