mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
f5921278f9
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). llvm-svn: 267276
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}
|