Fixes spam in the common case when linking together
many modules produced by the same compiler version.
Details
- Reviewers
dexonsmith tejohnson pcc
Diff Detail
Event Timeline
It’s unfortunate that this will be quadratic in the number of modules. Is there a way we could improve that?
Well the linker API only exposes linking one module into one other at at time, so I don't know. Currently we have the AMDGPUUnifyMetadata pass as a workaround which cleans these up in a pass over the fully linked module, so that avoids revisiting for each module but it would make more sense if the linker dealt with this.
I wonder whether it would be generally useful to support SetVectors in named metadata nodes. I'm not sure what the textual IR syntax would be, but I believe debug info would use it too.
lib/Linker/IRMover.cpp | ||
---|---|---|
1001–1005 | Do you need to reach inside to the strings? Why not just compare the nodes themselves? |
Something more general would be better. The custom pass currently handles 6 different items
Sadly I missed your last comment and this has languished :/.
If you are still interested in pursuing this, I suggest adding setvector semantics to NamedMetadata as an option, and then this patch is just migrating llvm.ident to it. A couple of comptions for syntax include:
!name{} = !{!0} !name{uniqued} = !{!0} !name! = !{!0} !name& = !{!0} !name &= !{!0} !name |= !{!0}
Please CC me on the RFC to llvm-dev.
Do you need to reach inside to the strings? Why not just compare the nodes themselves?