]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - opencl/llvm.git/commit
UseListOrder: Visit global values
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 30 Jul 2014 17:51:09 +0000 (17:51 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 30 Jul 2014 17:51:09 +0000 (17:51 +0000)
commit43b54db2a4db4648441f2887f4fb02412b815981
treecefc797be527a33bcc3eb74a969dad0ebbe5833a
parent8dc3e30075926ac2ed921ba1acb2b38e7ef88102
UseListOrder: Visit global values

When predicting use-list order, we visit functions in reverse order
followed by `GlobalValue`s and write out use-lists at the first
opportunity.  In the reader, this will translate to *after* the last use
has been added.

For this to work, we actually need to descend into `GlobalValue`s.
Added a targeted test in `use-list-order.ll` and `RUN` lines to the
newly passing tests in `test/Bitcode`.

There are two remaining failures in `test/Bitcode`:

  - blockaddress.ll: I haven't thought through how to model the way
    block addresses change the order of use-lists (or how to work around
    it).

  - metadata-2.ll: There's an old-style `@llvm.used` global array here
    that I suspect the .ll parser isn't upgrading properly.  When it
    round-trips through bitcode, the .bc reader *does* upgrade it, so
    the extra variable (`i8* null`) has an extra use, and the shuffle
    vector doesn't match.

    I think the fix is to upgrade old-style global arrays (or reject
    them?) in the .ll parser.

This is part of PR5680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214321 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Bitcode/Writer/ValueEnumerator.cpp
test/Bitcode/miscInstructions.3.2.ll
test/Bitcode/ssse3_palignr.ll
test/Bitcode/use-list-order.ll
test/Bitcode/variableArgumentIntrinsic.3.2.ll