1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/unittests/IR
Duncan P. N. Exon Smith 35f8930f4a BitcodeReader: Avoid referencing unresolved nodes from distinct ones
Each reference to an unresolved MDNode is expensive, since the RAUW
support in MDNode uses a separate allocation and side map.  Since
a distinct MDNode doesn't require its operands on creation (unlike
uniuqed nodes, there's no need to check for structural equivalence),
use nullptr for any of its unresolved operands.  Besides reducing the
burden on MDNode maps, this can avoid allocating temporary MDNodes in
the first place.

We need some way to track operands.  Invent DistinctMDOperandPlaceholder
for this purpose, which is a Metadata subclass that holds an ID and
points at its single user.  DistinctMDOperandPlaceholder::replaceUseWith
is just like RAUW, but its name highlights that there is only ever
exactly one use.

There is no support for moving (or, obviously, copying) these.  Move
support would be possible but expensive; leaving it unimplemented
prevents user error.  In the BitcodeReader I originally considered
allocating on a BumpPtrAllocator and keeping a vector of pointers to
them, and then I realized that std::deque implements exactly this.

A couple of obvious follow-ups:

  - Change ValueEnumerator to emit distinct nodes first to take more
    advantage of this optimization.  (How convenient... I think I might
    have a couple of patches for this.)

  - Change DIBuilder and its consumers (like CGDebugInfo in clang) to
    use something like this when constructing debug info in the first
    place.

llvm-svn: 267270
2016-04-23 04:15:56 +00:00
..
AsmWriterTest.cpp Fix crash when printing instructions that have a metadata attached but no parent. 2016-01-07 20:14:30 +00:00
AttributesTest.cpp Fix non-determinism in order of LLVM attributes 2016-04-04 23:06:05 +00:00
CMakeLists.txt IR: LLVMContextTest => DebugTypeODRUniquingTest, NFC 2016-04-19 17:11:06 +00:00
ConstantRangeTest.cpp [ConstantRange] Rename test; NFC 2016-03-03 18:31:33 +00:00
ConstantsTest.cpp Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
DebugInfoTest.cpp IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
DebugTypeODRUniquingTest.cpp IR: Enable debug info type ODR uniquing for forward decls 2016-04-19 18:00:19 +00:00
DominatorTreeTest.cpp Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
FunctionTest.cpp IRMover: Steal arguments when moving functions, NFC 2016-04-06 06:38:15 +00:00
InstructionsTest.cpp Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
IntrinsicsTest.cpp Handle more edge cases in intrinsic name binary search 2016-01-26 22:33:19 +00:00
IRBuilderTest.cpp Remove some unused variables 2016-03-13 22:00:18 +00:00
LegacyPassManagerTest.cpp [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
MDBuilderTest.cpp IR: Split Metadata from Value 2014-12-09 18:38:53 +00:00
MetadataTest.cpp BitcodeReader: Avoid referencing unresolved nodes from distinct ones 2016-04-23 04:15:56 +00:00
PassManagerTest.cpp Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
PatternMatch.cpp Remove PreserveNames template parameter from IRBuilder 2016-03-13 21:05:13 +00:00
TypeBuilderTest.cpp [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
TypesTest.cpp Fix several accidental DOS line endings in source files 2016-01-03 17:22:03 +00:00
UserTest.cpp Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
UseTest.cpp Format: Modernize using variadic templates. 2015-02-15 22:15:41 +00:00
ValueHandleTest.cpp Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
ValueMapTest.cpp Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
ValueTest.cpp Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
VerifierTest.cpp Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
WaymarkTest.cpp Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00