IR: Drop uniquing for self-referencing MDNodes
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 7 Dec 2014 19:52:06 +0000 (19:52 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 7 Dec 2014 19:52:06 +0000 (19:52 +0000)
commitac8ee289eb5438bdc222252f3e45f156c6b6730e
treeb454cd450bb525bd2f6c4648e7a8170ca5775fb8
parentd06c165bb20ab669d6f94c3207d57dcd9b5cb7ed
IR: Drop uniquing for self-referencing MDNodes

It doesn't make sense to unique self-referencing nodes.  Drop uniquing
for them.

Note that `MDNode::intersect()` occasionally returns self-referencing
nodes.  Previously these would be returned by `MDNode::get()`.  I'm not
convinced this was intended behaviour -- to me it seems it should return
a node whose only operand is the self-reference -- but I don't know much
about alias scopes so I'm preserving it for now.

This is part of PR21532.

llvm-svn: 223618
llvm/lib/IR/Metadata.cpp
llvm/unittests/IR/MetadataTest.cpp