[PredicateInfo] Use SmallVector instead of SmallPtrSet.
authorFlorian Hahn <flo@fhahn.com>
Thu, 25 Jul 2019 15:35:10 +0000 (15:35 +0000)
committerFlorian Hahn <flo@fhahn.com>
Thu, 25 Jul 2019 15:35:10 +0000 (15:35 +0000)
commitc0d0e3bda8ebfb24e84250188f852dc2409928cc
tree3a57f1fe481d5c1e3028da4156e9a452be3f18b9
parent46441fdb3c1da5d2c40263d160bdd585f0c3f7d3
[PredicateInfo] Use SmallVector instead of SmallPtrSet.

We do not need the SmallPtrSet to avoid adding duplicates to
OpsToRename, because we already keep a ValueInfo mapping. If we see an
op for the first time, Infos will be empty and we can also add it to
OpsToRename.

We process operands by visiting BBs depth-first and then iterate over
all instructions & users, so the order should be deterministic.
Therefore we can skip one round of sorting, which we purely needed for
guaranteeing a deterministic order when iterating over the SmallPtrSet.

Reviewers: efriedma, davide

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D64816

llvm-svn: 367028
llvm/include/llvm/Transforms/Utils/PredicateInfo.h
llvm/lib/Transforms/Utils/PredicateInfo.cpp
llvm/test/Transforms/Util/PredicateInfo/condprop.ll
llvm/test/Transforms/Util/PredicateInfo/testandor.ll