[PATCH] D92309: [LegacyPM] Update InversedLastUser on the fly. NFC.
    Bjorn Pettersson via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Jan 20 02:11:30 PST 2021
    
    
  
bjope added inline comments.
================
Comment at: llvm/include/llvm/IR/LegacyPassManagers.h:233
   // LastUser->second is the last user of Lastuser->first.
   DenseMap<Pass *, Pass *> LastUser;
 
----------------
I suggest adding a comment here that the intention is to always keep InversedLastUser in sync with this map.
================
Comment at: llvm/include/llvm/IR/LegacyPassManagers.h:236
   // Map to keep track of passes that are last used by a pass.
-  // This inverse map is initialized at PM->run() based on
-  // LastUser map.
   DenseMap<Pass *, SmallPtrSet<Pass *, 8> > InversedLastUser;
 
----------------
As above, I suggest adding a comment here that this map should be updated whenever LastUser is updated to keep them in sync.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92309/new/
https://reviews.llvm.org/D92309
    
    
More information about the llvm-commits
mailing list