<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 13 June 2014 13:34, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">>> Rafael Ávila de Espíndola wrote:<br>
>>> Why do you need it to be a Value? This says that a Comdat has a type, which seems wrong.<br>
>> It is a `Value` so that it can participate in things like use lists.<br>
>><br>
>> As an example why this is useful:<br>
>> If we want to drop a symbol in a COMDAT group, we need to prove we don't need any of the symbols in that group.  Iterating over users of the COMDAT is a straightforward way of doing this.<br>
>><br>
>> I could recreate this functionality just for COMDATs but it seemed like the right way to go.<br>
><br>
> We had problems in the past with a Class being too generic<br>
> (GlobalAlias being the most recent one), so I would suggest making it<br>
> specific.All you need to is add a "Use*" to the comdat class, no?<br>
<br>
</div>Now that I think of it, a comdat having Uses is probably undesirable<br>
in itself. Some of the potential issues that come to mind:<br>
<br>
* RAUW should not change what is in a comdat.<br></blockquote><div><br></div><div>I don't follow. Why shouldn't it?</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


* Logic for checking if something has only one use should also not be<br>
affected by comdats.<br></blockquote><div><br></div><div>The GV uses the comdat group, not the other way around?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


* Other code walking all uses probably be surprised to find a comdat.<br></blockquote><div><br></div><div>Well sure, it's a new IR extension. This happens to not come up in practice because you need to iterate the list of comdats in the module, or else grab a section and ask it for its comdat group. You could get there by accident (I think the section stores its comdat group as an operand) but that never comes up.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It looks comdats should keep track of what GVs are in them with some<br>
other mechanism. The simple option of just building this information<br>
when needed might be sufficient. I think the only cases where we would<br>
need it is<br>
<br>
* Some optimization to drop unused comdats if all their members can be dropped.<br>
* The linker.<br>
<br>
Both of these will be looking at the entire module, so they should be<br>
able to build the set of global values in each comdat as needed.<br></blockquote><div><br></div><div>Sure, but why? You're proposing that we reimplement functionality from Value because we don't need part of the functionality in Value. We want the value naming and its symbol table, and I'm pretty sure we want the use lists or equivalent functionality. We don't want a Type, but we can choose "i8" and move on?</div>

<div><br></div><div>Nick</div></div></div></div>