diff options
author | Mandeep Singh Grang <mgrang@codeaurora.org> | 2017-11-17 00:43:24 +0000 |
---|---|---|
committer | Mandeep Singh Grang <mgrang@codeaurora.org> | 2017-11-17 00:43:24 +0000 |
commit | e6bb66357c37fc12ede53cbb289ba632d0ba8944 (patch) | |
tree | b9f1db0682fdc023d34a1a7637397b74483c1f44 /llvm/lib/Transforms/Utils/PredicateInfo.cpp | |
parent | b5c237ec3d5f708e7118913923f3d50359dff40a (diff) | |
download | llvm-e6bb66357c37fc12ede53cbb289ba632d0ba8944.zip llvm-e6bb66357c37fc12ede53cbb289ba632d0ba8944.tar.gz llvm-e6bb66357c37fc12ede53cbb289ba632d0ba8944.tar.bz2 |
[PredicateInfo] Add comment about why we require stable sort
llvm-svn: 318487
Diffstat (limited to 'llvm/lib/Transforms/Utils/PredicateInfo.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/PredicateInfo.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp index 7751b6e..d47be6e 100644 --- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp +++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp @@ -611,6 +611,11 @@ void PredicateInfo::renameUses(SmallPtrSetImpl<Value *> &OpSet) { } convertUsesToDFSOrdered(Op, OrderedUses); + // Here we require a stable sort because we do not bother to try to + // assign an order to the operands the uses represent. Thus, two + // uses in the same instruction do not have a strict sort order + // currently and will be considered equal. We could get rid of the + // stable sort by creating one if we wanted. std::stable_sort(OrderedUses.begin(), OrderedUses.end(), Compare); SmallVector<ValueDFS, 8> RenameStack; // For each use, sorted into dfs order, push values and replaces uses with |