Lunderberg commented on code in PR #16523:
URL: https://github.com/apache/tvm/pull/16523#discussion_r1479902583


##########
src/arith/pattern_match.h:
##########
@@ -628,10 +628,11 @@ inline PRampExpr<TBase, TStride, TLanes> ramp(const 
Pattern<TBase>& base,
 }
 
 template <typename TBase>
-inline PRampExpr<TBase, PConstWithTypeLike<TBase>, PConst<int>> ramp(const 
Pattern<TBase>& base,
-                                                                     int 
stride, int lanes) {
-  return PRampExpr<TBase, PConstWithTypeLike<TBase>, PConst<int>>(
-      base.derived(), PConstWithTypeLike<TBase>(base.derived(), stride), 
PConst<int>(lanes));
+inline PRampExpr<TBase, PConstWithTypeLike<TBase>, PConstWithTypeLike<TBase>> 
ramp(
+    const Pattern<TBase>& base, int stride, int lanes) {
+  return PRampExpr<TBase, PConstWithTypeLike<TBase>, 
PConstWithTypeLike<TBase>>(
+      base.derived(), PConstWithTypeLike<TBase>(base.derived(), stride),

Review Comment:
   Thank you for drawing attention to it, and I think this overload looks 
reasonable with the `int lanes` argument.  The purpose of this overload is to 
define patterns that have a specific value, but whose dtype doesn't matter for 
the purpose of matching.  So, `ramp(pvar_base, 1, 4)` would match vectorized 
groups of 4 values, regardless of whether the `4` was stored as 
`IntImm(DataType::Int(32), 4)` or `IntImm(DataType::Int(64), 4)`.



-- 
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]

Reply via email to