Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UseListOrder] Fix use list order for function operands
Functions can have a personality function, as well as prefix and prologue data as additional operands. Unused operands are assigned a dummy value of i1* null. This patch addresses multiple issues in use-list order preservation for these: * Fix verify-uselistorder to also enumerate the dummy values. This means that now use-list order values of these values are shuffled even if there is no other mention of i1* null in the module. This results in failures of Assembler/call-arg-is-callee.ll, Assembler/opaque-ptr.ll and Bitcode/use-list-order2.ll. * The use-list order prediction in ValueEnumerator does not take into account the fact that a global may use a value more than once and leaves uses in the same global effectively unordered. We should be comparing the operand number here, as we do for the more general case. * While we enumerate all operands of a function together (which seems sensible to me), the bitcode reader would first resolve prefix data for all function, then prologue data for all functions, then personality functions for all functions. Change this to resolve all operands for a given function together instead. Differential Revision: https://reviews.llvm.org/D109282
- Loading branch information
Showing
4 changed files
with
74 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; RUN: verify-uselistorder %s | ||
|
||
@g = global i8 0 | ||
|
||
define void @f1() prefix i8* @g prologue i8* @g personality i8* @g { | ||
ret void | ||
} | ||
|
||
define void @f2() prefix i8* @g prologue i8* @g personality i8* @g { | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters