[all-commits] [llvm/llvm-project] f77342: [CGSCC] Properly handle invalidating analyses for ...

aeubanks via All-commits all-commits at lists.llvm.org
Wed Sep 21 09:50:22 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f77342693b46e1ae7924a340128a5b14e4137b2e
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   2022-09-21 (Wed, 21 Sep 2022)

  Changed paths:
    M llvm/lib/Analysis/CGSCCPassManager.cpp
    A llvm/test/Other/invalidated-cgscc-invalidate-analyses.ll

  Log Message:
  [CGSCC] Properly handle invalidating analyses for invalidated SCCs

Currently if we mark an SCC as invalid, if we haven't set UR.UpdatedC, we won't propagate the PreservedAnalyses up to the parent pass (adaptor/pass manager).

In the provided test case, we inline the function into itself then delete it as it has no users. The SCC is marked as invalid without providing a replacement UR.UpdatedC. Then the CGSCC pass manager and adaptor discard the PreservedAnalyses. Instead, handle PreservedAnalyses first before bailing due to the invalid SCC.

Fixes crashes due to out of date analyses.

More information about the All-commits mailing list