diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-08-19 21:30:15 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-08-19 21:30:15 +0000 |
commit | 0a448fbca323014f1754cb16a56d698cdb18d258 (patch) | |
tree | 6b2b2c025ef9c60421e610db2a1bc02a54890629 /llvm/docs | |
parent | df7be5105a124233d063bfb55dfe4b80f88e0481 (diff) | |
download | bcm5719-llvm-0a448fbca323014f1754cb16a56d698cdb18d258.tar.gz bcm5719-llvm-0a448fbca323014f1754cb16a56d698cdb18d258.zip |
IR: Implement uselistorder assembly directives
Implement `uselistorder` and `uselistorder_bb` assembly directives,
which allow the use-list order to be recovered when round-tripping to
assembly.
This is the bulk of PR20515.
llvm-svn: 216025
Diffstat (limited to 'llvm/docs')
-rw-r--r-- | llvm/docs/LangRef.rst | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index bcf4f651829..649df4c5878 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -1749,6 +1749,45 @@ otherwise unsafe floating point operations dramatically change results in floating point (e.g. reassociate). This flag implies all the others. +.. _uselistorder: + +Use-list Order Directives +------------------------- + +Use-list directives encode the in-memory order of each use-list, allowing the +order to be recreated. ``<order-indexes>`` is a comma-separated list of +indexes that are assigned to the referenced value's uses. The referenced +value's use-list is immediately sorted by these indexes. + +Use-list directives may appear at function scope or global scope. They are not +instructions, and have no effect on the semantics of the IR. When they're at +function scope, they must appear after the terminator of the final basic block. + +If basic blocks have their address taken via ``blockaddress()`` expressions, +``uselistorder_bb`` can be used to reorder their use-lists from outside their +function's scope. + +:Syntax: + +:: + + uselistorder <ty> <value>, { <order-indexes> } + uselistorder_bb @function, %block { <order-indexes> } + +:Examples: + +:: + + ; At function scope. + uselistorder i32 %arg1, { 1, 0, 2 } + uselistorder label %bb, { 1, 0 } + + ; At global scope. + uselistorder i32* @global, { 1, 2, 0 } + uselistorder i32 7, { 1, 0 } + uselistorder i32 (i32) @bar, { 1, 0 } + uselistorder_bb @foo, %bb, { 5, 1, 3, 2, 0, 4 } + .. _typesystem: Type System |