From commits-return-13697-archive-asf-public=cust-asf.ponee.io@tvm.apache.org Wed May 20 01:11:01 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id F244C180638 for ; Wed, 20 May 2020 03:11:00 +0200 (CEST) Received: (qmail 22541 invoked by uid 500); 20 May 2020 01:11:00 -0000 Mailing-List: contact commits-help@tvm.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tvm.apache.org Delivered-To: mailing list commits@tvm.apache.org Received: (qmail 22532 invoked by uid 99); 20 May 2020 01:11:00 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 May 2020 01:11:00 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 437868BFBD; Wed, 20 May 2020 01:11:00 +0000 (UTC) Date: Wed, 20 May 2020 01:11:00 +0000 To: "commits@tvm.apache.org" Subject: [incubator-tvm] branch master updated: [BYOC][MergeComposite] if root->args[i] isn't a CallNode, then Donwcast will check fail (#5623) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <158993705995.3834.14396343054139997540@gitbox.apache.org> From: masahi@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-tvm X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 0d1a9544e2b024fd2763e4de571a5fb527656241 X-Git-Newrev: 6cbda80227fc18a859c4b01f57f75abbd7a16181 X-Git-Rev: 6cbda80227fc18a859c4b01f57f75abbd7a16181 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. masahi pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git The following commit(s) were added to refs/heads/master by this push: new 6cbda80 [BYOC][MergeComposite] if root->args[i] isn't a CallNode, then Donwcast will check fail (#5623) 6cbda80 is described below commit 6cbda80227fc18a859c4b01f57f75abbd7a16181 Author: windclarion AuthorDate: Wed May 20 09:10:50 2020 +0800 [BYOC][MergeComposite] if root->args[i] isn't a CallNode, then Donwcast will check fail (#5623) we needn't execute L131 "call_map->Set(arg, new_arg)", because when arg is CallNode and root->args[i] is not CallNode, new_arg will be a null pointer. There is no point in caching null pointer. Signed-off-by: windclarion --- src/relay/transforms/merge_composite.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/relay/transforms/merge_composite.cc b/src/relay/transforms/merge_composite.cc index b9eef74..596e2a1 100644 --- a/src/relay/transforms/merge_composite.cc +++ b/src/relay/transforms/merge_composite.cc @@ -121,7 +121,7 @@ class MergeCompositeWrapper : public ExprMutator { Array new_args; for (const auto& arg : pattern->args) { Expr new_arg; - if (arg->IsInstance()) { + if (arg->IsInstance() && root->args[i]->IsInstance()) { new_arg = ExtractPattern(Downcast(arg), Downcast(root->args[i]), var_map, call_map); // if we've already processed this call node, return the previous result