Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Allow eliminating common subexpressions when temp space is used (#19487)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrendx authored Nov 7, 2020
1 parent b30b9c1 commit 9edd84b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/executor/eliminate_common_expr_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,15 @@ bool NodeEqual(const Node* n, const Node* m) {
// to be eligible
static auto& resource_request = Op::GetAttr<FResourceRequest>("FResourceRequest");
static auto& resource_request_ex = Op::GetAttr<FResourceRequestEx>("FResourceRequestEx");
if (resource_request.get(n->op(), nullptr) != nullptr) return false;
const auto fresource_request = resource_request.get(n->op(), nullptr);
if (fresource_request != nullptr) {
const auto& requests = fresource_request(n->attrs);
for (const auto& req : requests) {
if (req.type != ResourceRequest::kTempSpace) {
return false;
}
}
}
if (resource_request_ex.get(n->op(), nullptr) != nullptr) return false;

return true;
Expand Down

0 comments on commit 9edd84b

Please sign in to comment.