<div dir="ltr"><div>Hello all,<br></div><br><div>I would like to get feedback for two patches that enable clang's noundef analysis flag by default.</div><div>The two patches are: <a href="https://reviews.llvm.org/D105169">https://reviews.llvm.org/D105169</a> , <a href="https://reviews.llvm.org/D108453">https://reviews.llvm.org/D108453</a> .</div><div>They are splitted for readability, but they will be merged into one commit and pushed if accepted.</div><div><br></div><div>The noundef analysis flag was added by D81678 <<a href="https://reviews.llvm.org/D81678" rel="noreferrer" target="_blank">https://reviews.llvm.org/D81678</a>> in the past. </div><div>Its goal is to mark arguments and return values in C/C++ as `noundef` if legal.</div><div><br>Besides its performance benefit to sanitizers, which was the main motivation, attaching `noundef` is beneficial because it allows quite a few optimizations that are unsound w.r.t. undef or poison (they are usually guarded with `isGuaranteedNotToBeUndefOrPoison` check).<br></div><div>Since the fact that arg/ret values are noundef is derived from the source language (C/C++)'s specification, the information is permanently lost unless explicitly attached by clang (as other dereferenceable/align/... attributes from C/C++ do).<br><br></div><div>Previously, the flag was not activated by default because it required a lot of tests to be updated.</div><div>This can raise conflicts with downstream patches (discussed in this thread: D82317 <<a href="https://reviews.llvm.org/D82317" rel="noreferrer" target="_blank">https://reviews.llvm.org/D82317</a>>)</div><div><br></div><div>To avoid conflicts, I'd like to update requested tests by simply adding `-disable-noundef-analysis` at `// RUN: %clang_cc1 ...` rather than updating their texts (which is what D108453 is already doing).</div><div>For the requested directories or tests, I'll simply add the flag to the `RUN:` command.<br></div><div>This will reduce the opportunity of raising conflicts with downstreams.</div><div><br></div><div>Any questions or concerns about enabling the flag are appreciated.</div><div>The two patches are written by Hyeongyu Kim, and I'm a messenger for the patches. :)</div><div><br></div><div>Sincerely,</div><div>Juneyoung</div></div>