[PATCH] D25848: [PM/OptBisect] Don't crash with some particular values of -opt-bisect-limit=

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 12:49:52 PST 2016


davide added a subscriber: danielcdh.
davide added a comment.

In https://reviews.llvm.org/D25848#624162, @andrew.w.kaylor wrote:

> What do you think of this change instead?
>
>   Index: lib/Transforms/Scalar/LICM.cpp
>   ===================================================================
>   --- lib/Transforms/Scalar/LICM.cpp	(revision 289480)
>   +++ lib/Transforms/Scalar/LICM.cpp	(working copy)
>   @@ -124,8 +124,13 @@
>      }
>   
>      bool runOnLoop(Loop *L, LPPassManager &LPM) override {
>   -    if (skipLoop(L))
>   +    if (skipLoop(L)) {
>   +      // If we have run LICM on a previous loop but now we are skipping
>   +      // (because we've hit the opt-bisect limit), we need to clear the
>   +      // loop alias information.
>   +      LICM.getLoopToAliasSetMap().clear();
>          return false;
>   +    }
>   
>        auto *SE = getAnalysisIfAvailable<ScalarEvolutionWrapperPass>();
>        return LICM.runOnLoop(L,
>


I consider this reasonable, but I don't feel qualified enough to review as I'm not a LICM expert, so I'm CC:ing @danielcdh  . I'm slightly worried about other passes hitting a similar issue (expecting some state to be freed and asserting in `doFinalization()`)


https://reviews.llvm.org/D25848





More information about the llvm-commits mailing list