csullivan commented on a change in pull request #7686:
URL: https://github.com/apache/tvm/pull/7686#discussion_r690890097
##########
File path: src/tir/transforms/lower_tvm_builtin.cc
##########
@@ -98,6 +98,15 @@ class BuiltinLower : public StmtExprMutator {
}
}
+ Stmt VisitStmt_(const LetStmtNode* op) final {
Review comment:
In this case I mutate the let
```
let buffer = texture2d_alloca(...)
```
to include stmts to check that the return value of the call is not nullptr,
to include the free of the allocation in a sequence, and to check for non-zero
return value of the free. This is behaving similar to the handling of the
Allocate visitor.
I'm quite open to alternatives if there is a better approach that I missed.
##########
File path: src/target/source/codegen_c.h
##########
@@ -194,6 +194,8 @@ class CodeGenC : public ExprFunctor<void(const PrimExpr&,
std::ostream&)>,
virtual std::string CastFromTo(std::string value, DataType from, DataType
target);
// Get load of single element with expression
virtual void PrintVecElemLoadExpr(DataType t, int i, const std::string&
value, std::ostream& os);
+ // Print restrict keyword for a given Var if applicable
+ virtual void PrintRestrict(const Var& v, std::ostream& os);
Review comment:
This is the no-aliasing qualifier for opencl kernels. A compiler hint
that pointer aliasing does not occur among the restricted pointer arguments.
--
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]