mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214417 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user