Lines Matching refs:CPred
1158 1. `CPred`: the primitive leaf predicate.
1163 `CPred` is the basis for composing more complex predicates. It is the "atom"
1168 You can put any C++ code that returns a boolean value inside a `CPred`,
1183 `CPred<"$_self.isa<BoolAttr>()">`. Then for `BoolAttr:$attr`,`$_self` will be
1195 just call `attr.isa<IntegerAttr>()`. The code can be wrapped in a `CPred` as
1199 For more complicated predicates, you can wrap it in a single `CPred`, or you can
1205 CPred<"$_self.isa<IntegerAttr>()">,
1207 CPred<"$_self.cast<IntegerAttr>().getType().isInteger(32)">,
1208 CPred<"$_self.cast<IntegerAttr>().getType().isInteger(64)">
1214 `CPred` and predicate combiners to write complicated predicates. For integer
1221 If the predicate is very complex to write with `CPred` together with predicate
1222 combiners, you can also write it as a normal C++ function and use the `CPred` as
1233 def HasSomeProperty : AttrConstraint<CPred<"HasSomeProperty($_self)">,
1244 As to whether we should define the predicate using a single `CPred` wrapping the
1245 whole expression, multiple `CPred`s with predicate combiners, or a single
1246 `CPred` "invoking" a function, there are no clear-cut criteria. Defining using
1247 `CPred` and predicate combiners is preferable since it exposes more information