<div class="gmail_quote">On Tue, Aug 30, 2011 at 4:59 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@apple.com" target="_blank">echristo@apple.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>
On Aug 29, 2011, at 4:58 PM, Jan Voung wrote: </div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>> - Is this approach acceptable?</div>
<div>
>   - I guess it is hard to test if this has any effect / depends on the compiler.<br>
<br>
</div>I'm not really wild about this approach, no. I'd prefer separating out the targets from each other and then conditionally compiling in support rather than relying on DCE and LTO to decide whether or not the code should be there. I'm open to other ideas/discussion on it though.</blockquote>

<div><br></div><div>Hmm I'll have to think a bit more about how to facilitate conditionally compiling-in support (e.g., the way lib/Target/X is done). The OS and environment checks + inline code are currently quite widespread. Here is an estimate:</div>

<div><br></div><div><div>grep -r "isOSDarwin" . | grep -v "\.svn" | wc -l</div><div>44</div><div>grep -r "isMacOSX" . | grep -v "\.svn" | wc -l</div><div>30</div><div>grep -r "isTargetDarwin" . | grep -v "\.svn" | wc -l</div>
<div>58</div><div>grep -r "Triple::Darwin" . | grep -v "\.svn" | wc -l</div>
<div>21</div><div>grep -r "Triple::MachO" . | grep -v "\.svn" | wc -l</div><div>9</div><div>grep -r "Triple::IOS" . | grep -v "\.svn" | wc -l</div><div>4</div><div>grep -r "Triple::MacOSX" . | grep -v "\.svn" | wc -l</div>

<div>4</div><div><br></div><div>grep -r "isOSWindows" . | grep -v "\.svn" | wc -l</div><div>11</div><div>grep -r "isTargetWindows" . | grep -v "\.svn" | wc -l</div>
<div>13</div><div>grep -r "isTargetCygwin" . | grep -v "\.svn" | wc -l</div><div>3</div><div>grep -r "isTargetCygMing" . | grep -v "\.svn" | wc -l</div><div>14</div><div>grep -r "Triple::Win32" . | grep -v "\.svn" | wc -l</div>
<div>14</div><div>grep -r "Triple::Cygwin" . | grep -v "\.svn" | wc -l</div><div>10</div><div>grep -r "Triple::MinGW32" . | grep -v "\.svn" | wc -l</div>
<div>14</div><div><br></div><div>
grep -r "Triple::Linux" . | grep -v "\.svn" | wc -l</div><div>14</div><div>grep -r "isTargetLinux" . | grep -v "\.svn" | wc -l</div><div>5</div><div>grep -r "Triple::OpenBSD" . | grep -v "\.svn" | wc -l</div>

<div>7</div><div>...</div><div>Total matches so far: 275</div></div><div><br></div><div>Perhaps there are some cases that may be easy to refactor, yet account for most of the bytes. Refactoring everything will probably take a while. The fact that many of them overlap in certain ways (e.g., isTargetCygMing) makes it... harder. Anyway, I'll think about it more. Thanks!</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
> - Is trimming the size of the llvm binaries (via config flags) useful to others?<br>
>   - Other examples:<br>
>     - make "include/llvm/Intrinsics.td" not #include intrinsincs for targets that were not enabled through "--enable-target"<br>
>     - config flags to avoid building unused register allocators, other passes<br>
<br>
</div>This is quite useful in general, I'm just not a fan of the current method.<br>
<br>
The cleanups that you have are definitely useful patches and I hope you'll submit those separately.</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Thanks!<br>
<font color="#888888"><br>
-eric<br>
<br>
</font></blockquote></div><br>