mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
[jit] Implement one-argument AliasDb::mayContainAlias more efficiently (#65177)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/65177 There is no need to heap-allocate any vectors in this case. ghstack-source-id: 140052520 Test Plan: CI Startup for static runtime on ctr_mobile_feed local net decreased from 7.8s to about 7.0s Reviewed By: malfet Differential Revision: D30984194 fbshipit-source-id: 85091e55445f653ec728b27da4b459a2f1873013
This commit is contained in:
parent
c80693f7e6
commit
94845fc44e
|
|
@ -1214,10 +1214,10 @@ bool AliasDb::mayAlias(const ValueSet& a, const ValueSet& b) const {
|
|||
}
|
||||
|
||||
bool AliasDb::mayContainAlias(Value* a, Value* b) const {
|
||||
const std::vector<Value*> a_vec = {a};
|
||||
const std::vector<Value*> b_vec = {b};
|
||||
|
||||
return mayContainAlias(a_vec, b_vec);
|
||||
if (!isMutableTypeInternal(a) || !isMutableTypeInternal(b)) {
|
||||
return false;
|
||||
}
|
||||
return memoryDAG_->mayContainAlias(elementMap_.at(a), elementMap_.at(b));
|
||||
}
|
||||
|
||||
std::vector<Element*> AliasDb::getElements(at::ArrayRef<Value*> vs) const {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user