wrongtest opened a new pull request #9016:
URL: https://github.com/apache/tvm/pull/9016
This PR add two helper class for tir expression pattern match.
- `PVarWithType` works same as `PVar` with dtype match
- `PVecType` represent a wildcard vec type placeholder same as
`PVar<DataType>`, but with element dtype match
```c++
PVecType vec_ph(DataType::Float(32));
PVarWithType<PrimExpr, arith::PVecType> pat(vec_ph);
if (pat.Match(expr)) { ... }
// equaivalent to
PVar<PrimExpr> pat;
if (pat.Match(expr)) {
PrimExpr x = pat.Eval();
if (x->dtype == DataType::Float(32)) { ... }
}
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]