Hzfengsy commented on a change in pull request #10582:
URL: https://github.com/apache/tvm/pull/10582#discussion_r825547267



##########
File path: src/target/llvm/codegen_llvm.h
##########
@@ -439,7 +439,7 @@ class CodeGenLLVM : public ExprFunctor<llvm::Value*(const 
PrimExpr&)>,
   // deep comparison of PrimExpr
   ExprDeepEqual deep_equal_;
   // binding of let variables. Enables duplicate var defs that map to same 
value
-  std::unordered_map<Var, const LetNode*, ObjectPtrHash, ObjectPtrEqual> 
let_binding_;
+  std::unordered_map<Var, PrimExpr, ObjectPtrHash, ObjectPtrEqual> 
let_binding_;

Review comment:
       Could you please explain this change?

##########
File path: src/target/llvm/codegen_llvm.cc
##########
@@ -1249,15 +1249,14 @@ llvm::Value* CodeGenLLVM::VisitExpr_(const SelectNode* 
op) {
 llvm::Value* CodeGenLLVM::VisitExpr_(const LetNode* op) {
   auto it = let_binding_.find(op->var);
   if (it != let_binding_.end()) {
-    ICHECK(deep_equal_(it->second->value, op->value))
+    ICHECK(deep_equal_(it->second, op->value))
         << "Let cannot bind the same var to two different values";
   } else {
-    let_binding_[op->var] = op;
+    let_binding_[op->var] = op->value;
   }
   auto var_value = MakeValue(op->value);
   var_map_[op->var.get()] = var_value;
   var_value->setName(op->var->name_hint.c_str());
-  analyzer_->Bind(op->var, op->value);

Review comment:
       Why don't we need `bind` here?




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