[PATCH] D78326: [PredicateInfo] Factor out temporary state (NFC)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 15:04:50 PDT 2020


nikic marked an inline comment as done.
nikic added inline comments.


================
Comment at: include/llvm/Transforms/Utils/PredicateInfo.h:249
   void buildPredicateInfo();
-  void processAssume(IntrinsicInst *, BasicBlock *, SmallVectorImpl<Value *> &);
-  void processBranch(BranchInst *, BasicBlock *, SmallVectorImpl<Value *> &);
-  void processSwitch(SwitchInst *, BasicBlock *, SmallVectorImpl<Value *> &);
-  void renameUses(SmallVectorImpl<Value *> &);
+  void processAssume(IntrinsicInst *, BasicBlock *, State &);
+  void processBranch(BranchInst *, BasicBlock *, State &);
----------------
fhahn wrote:
> Could all those helpers be moved into `State`? 
> 
> That way, we would not need to thread the parameter through the code and we would even more cleanly separate the build phase. If it is possible to move the construction parts into State, it might make sense to rename it to something like PredicateInfoBuilder and PredicateInfo itself would only contain PredicateMap, CreatedDeclarations, AllInfos. The builder could hold references to those.
That should be possible, if we pass a PredicateInfo reference into State (and make it a friend class), so that we have access to AllInfos etc. I'll give it a try.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78326/new/

https://reviews.llvm.org/D78326





More information about the llvm-commits mailing list