<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Feb 24, 2016 at 10:56 PM Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">----- Original Message -----<br>
> From: "Sanjoy Das" <<a href="mailto:sanjoy@playingwithpointers.com" target="_blank">sanjoy@playingwithpointers.com</a>><br>
> To: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov" target="_blank">hfinkel@anl.gov</a>><br>
> Cc: "Chandler Carruth" <<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>>, "llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>, "Philip Reames"<br>
> <<a href="mailto:listmail@philipreames.com" target="_blank">listmail@philipreames.com</a>>, "Duncan P. N. Exon Smith" <<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>><br>
> Sent: Thursday, February 25, 2016 12:25:54 AM<br>
> Subject: Re: [llvm-dev] Possible soundness issue with available_externally (split from "RFC: Add guard intrinsics")<br>
><br>
><br>
> Hal Finkel wrote:<br>
><br>
>  > But it is not all optimizations that are the problem. Rather, it<br>
>  > seems like a select few (e.g. things involving collapsing allowed<br>
>  > non-determinism in atomics), and losing those optimizations seems<br>
>  > better than generally losing function-attribute deduction.<br>
><br>
> If we go by the langref, then optimizations that fold undef are also<br>
> problematic (though most C/C++ programs resulting in such IR would<br>
> have UB in practice).<br>
<br>
If the undef is folded to some concrete value (instead of just being propagated), then yes, I agree. We really should be propagating the undef, however, right?<br></blockquote><div><br></div><div>But we're allowed to fold it. And we do fold it to a concrete identity value in an operand of some operation all the time. Or as a function call argument. Or ...</div></div></div>