<div dir="ltr">Hello,<div><br></div><div>Please check code:</div><div><a href="https://godbolt.org/g/wtimXj">https://godbolt.org/g/wtimXj</a><br></div><div><br></div><div>Clang surprisingly generates worse code for common pattern</div><div>if (!ptr)</div><div>    return NULL;</div><div><br></div><div>than for</div><div><div>if (!ptr)</div><div>    return ptr;</div></div><div><br></div><div><br></div><div>Gcc generates same code.</div><div><br></div><div>I checked the InstCombine's code and tried something to fix it but no success. </div><div>So I will leave this here for more skilled developers and maybe the could fix this problem.</div></div>