[PATCH] D109282: [UseListOrder] Fix use list order for function operands

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 4 15:01:19 PDT 2021


nikic created this revision.
nikic added a reviewer: dexonsmith.
Herald added a subscriber: hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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 (how I got here...) 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 comparison 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 resolve first 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109282

Files:
  llvm/lib/Bitcode/Reader/BitcodeReader.cpp
  llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
  llvm/tools/verify-uselistorder/verify-uselistorder.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109282.370768.patch
Type: text/x-patch
Size: 8025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210904/8c4ad014/attachment.bin>


More information about the llvm-commits mailing list