<div dir="ltr">In which i repeat my claim that trying to keep caches up to date is significantly harder to get right and verify than incremental recomputation :)<div> I additionally claim that we should actually quantify the performance benefits of doing either over "recomputing once or twice during pipeline" before going down this route.<div><br></div><div>We are *already* trading off compile time performance vs generated code performance. </div><div><br></div><div>All other things being equal, we should trade it off in a way that makes maintenance of code and verification of correctness as easy as possible.</div><div><br></div><div>Asserting that a good tradeoff to reduce compile time is "cache" instead of "stop doing it on demand" (or incrementally recompute), without any data other than compile time performance seems ... not particularly scientific.</div><div><br></div><div>It's certainly true that caching is often posited as "easier", but i think a trip through bugzilla would put this idea to rest.</div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 24, 2017 at 3:33 PM, Craig Topper via Phabricator <span dir="ltr"><<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">craig.topper added a comment.<br>
<br>
I'm seeing more problems than just nsw/nuw flags here.<br>
<br>
sext.ll test is failing because SimplifyDemandedInstructions bits determined that this<br>
<br>
%and = and i32 %x, 16<br>
<br>
shl i32 %and, 27<br>
<br>
Simplified to just the shl because we were only demanding the MSB of the shift. This occurred after we had cached the known bits for the shl as having 31 lsbs as 0. But without the "and" in there we can no longer guarantee the lower bits of the shift result are 0.<br>
<br>
I also got a failure on shift.ll not reported here. This was caused by getShiftedValue rewriting operands and changing constants of other shifts. This effectively shifts the Known bits and thus the cache needs to be invalidate.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D31239" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D31239</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>