When a cold path is outlined, the value tracking in the assumption cache may be
invalidated due to the code motion. We would previously trip an assertion in
subsequent passes (but required the passes to happen in a single run as the
assumption cache is shared across the passes). Invalidating the cache ensures
that we get the correct information when needed with the legacy pass manager as
well.
Details
Details
- Reviewers
hiraditya
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Transforms/IPO/HotColdSplitting.cpp | ||
---|---|---|
665 | LookupAC(F) may return a nullptr, so we might have to take care of that. |
Comment Actions
It's weird though. Nothing else calls AssumptionCache::clear().
*Why* it is being preserved? It seems there might be a bigger bug.
Comment Actions
Assumptions shouldn't change by optimization, code movement etc AFAICT. As Assumption cache doesn't currently have APIs to accomodate the changes caused by function splitting, invalidating the cache seems reasonable to me. If another pass requests for assumptions, they will be re-scanned, include/llvm/Analysis/AssumptionCache.h:132
LookupAC(F) may return a nullptr, so we might have to take care of that.