aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-07-31 18:33:12 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-07-31 18:33:12 +0000
commitab6adeb8a148ddd313e1220939bd2eb3bc63a328 (patch)
treeafab6cfe7d172364d5dee4924acc5c450003744c /llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
parent5a298679d5f6c38625244b1e86bd41c5b5c196dc (diff)
downloadllvm-ab6adeb8a148ddd313e1220939bd2eb3bc63a328.zip
llvm-ab6adeb8a148ddd313e1220939bd2eb3bc63a328.tar.gz
llvm-ab6adeb8a148ddd313e1220939bd2eb3bc63a328.tar.bz2
UseListOrder: Handle self-users
Correctly sort self-users (such as PHI nodes). I added a targeted test in `test/Bitcode/use-list-order.ll` and the final missing RUN line to tests in `test/Assembly`. This is part of PR5680. llvm-svn: 214417
Diffstat (limited to 'llvm/lib/Bitcode/Writer/ValueEnumerator.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/ValueEnumerator.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
index 2ac53fea..4ed739e 100644
--- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -166,13 +166,13 @@ static void predictValueUseListOrderImpl(const Value *V, const Function *F,
// If ID is 4, then expect: 7 6 5 1 2 3.
if (LID < RID) {
- if (RID < ID)
+ if (RID <= ID)
if (!IsGlobalValue) // GlobalValue uses don't get reversed.
return true;
return false;
}
if (RID < LID) {
- if (LID < ID)
+ if (LID <= ID)
if (!IsGlobalValue) // GlobalValue uses don't get reversed.
return false;
return true;
@@ -180,7 +180,7 @@ static void predictValueUseListOrderImpl(const Value *V, const Function *F,
// LID and RID are equal, so we have different operands of the same user.
// Assume operands are added in order for all instructions.
- if (LID < ID)
+ if (LID <= ID)
if (!IsGlobalValue) // GlobalValue uses don't get reversed.
return LU->getOperandNo() < RU->getOperandNo();
return LU->getOperandNo() > RU->getOperandNo();