mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-11 13:44:28 +00:00
e7a2c97bc2
When an operand of a distinct node hasn't been read yet, the reader can use a DistinctMDOperandPlaceholder. This is much cheaper than forward referencing from a uniqued node. Change ValueEnumerator::organizeMetadata to partition distinct nodes and uniqued nodes to reduce the overhead of cycles broken by distinct nodes. Mehdi measured this for me; this removes most of the RAUW from the importing step of -flto=thin, even after a WIP patch that removes string-based DITypeRefs (introducing many more cycles to the metadata graph). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267276 91177308-0d34-0410-b5e6-96231b3b80d8
19 lines
555 B
LLVM
19 lines
555 B
LLVM
; RUN: llvm-as <%s | llvm-bcanalyzer -dump | FileCheck %s
|
|
; Check that distinct nodes are emitted before uniqued nodes, even if that
|
|
; breaks post-order traversals.
|
|
|
|
; Nodes in this testcase are numbered to match how they are referenced in
|
|
; bitcode. !1 is referenced as opN=1.
|
|
|
|
; CHECK: <DISTINCT_NODE op0=2/>
|
|
!1 = distinct !{!2}
|
|
|
|
; CHECK-NEXT: <NODE op0=1/>
|
|
!2 = !{!1}
|
|
|
|
; Note: named metadata nodes are not cannot reference null so their operands
|
|
; are numbered off-by-one.
|
|
; CHECK-NEXT: <NAME
|
|
; CHECK-NEXT: <NAMED_NODE op0=1/>
|
|
!named = !{!2}
|