[PATCH] D30003: AssumptionCache: Disable the verifier by default, move it behind a hidden cl::opt and verify from releaseMemory().

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 19 00:28:37 PST 2017


sanjoy added a comment.

> We should use the flag introduced in this pass to search out and fix these things, but in the mean time, we shouldn't trouble our users with assertion failures.

[realized after writing: I guess this is what @chandlerc said above?]
The other option would be to not make it an `ImmutablePass` and instead treat it like an analysis that gets preserved explicitly.

Btw, in WritingAnLLVMPass.rst `ImmutablePass` is described as "that do not have to be run, do not change state, and //never need to be updated//".  That means either AC is not an `ImmutablePass` or the definition of an immutable pass needs to be relaxed.



================
Comment at: llvm/trunk/include/llvm/Analysis/AssumptionCache.h:171
 /// This is essentially a workaround for the legacy pass manager's weaknesses
 /// which associates each assumption cache with Function and clears it if the
 /// function is deleted. The nature of the AssumptionCache is that it is not
----------------
"The nature of the AssumptionCache is that it is not invalidated by any changes to the function body" no longer seems accurate.

Since forgetting to update the AC (after cloning) will fail "verification", perhaps we should either state that cloning will invalidate AC or avoid calling the thing we do later "verification"?


Repository:
  rL LLVM

https://reviews.llvm.org/D30003





More information about the llvm-commits mailing list