<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Jan 20, 2017 at 1:15 AM James Molloy <<a href="mailto:James.Molloy@arm.com">James.Molloy@arm.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey Chandler,<br class="gmail_msg">
<br class="gmail_msg">
Thanks for bringing this up. As I see it:<br class="gmail_msg">
<br class="gmail_msg">
The advantage of (1) is that it allows easier exploration of IR - I can run the optimizer in -O2, optsize and minsize mode all without going back to clang.<br class="gmail_msg">
<br class="gmail_msg">
The advantage of (2) is that it works with LTO… and I think that must trump all other concerns, as you said. In fact, the advantage of (1) I just stated could be gained by simply “opt -force-attribute=*:minsize” (do we have a wildcard match for -force-attribute? if we don’t, we should). So while unwieldy, it does work (and ideally should be documented!)<br class="gmail_msg"></blockquote><div><br></div><div>If we go with (2), I'm happy to work on a mechanism in the opt tool to essentially automate this process to implement '-Oz' so that it won't be any harder than it is today. But I suspect it would be better to spell the option differently to make it clear that it will *transform* the IR to get this, not just a mode setting. Maybe a dedicated pass that is essentially the force attribute you describe, but canned for forcing these attributes globally when not already present on functions.</div></div></div>