summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMandeep Singh Grang <mgrang@codeaurora.org>2017-11-17 00:43:24 +0000
committerMandeep Singh Grang <mgrang@codeaurora.org>2017-11-17 00:43:24 +0000
commite6bb66357c37fc12ede53cbb289ba632d0ba8944 (patch)
treeb9f1db0682fdc023d34a1a7637397b74483c1f44 /llvm/lib/Transforms
parentb5c237ec3d5f708e7118913923f3d50359dff40a (diff)
downloadbcm5719-llvm-e6bb66357c37fc12ede53cbb289ba632d0ba8944.tar.gz
bcm5719-llvm-e6bb66357c37fc12ede53cbb289ba632d0ba8944.zip
[PredicateInfo] Add comment about why we require stable sort
llvm-svn: 318487
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/PredicateInfo.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp
index 7751b6e1340..d47be6ea566 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
OpenPOWER on IntegriCloud