[PATCH] D149428: [BBUtils][NFC] Delete SplitBlockAndInsertIfThen with DT.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 9 04:42:59 PDT 2023


fhahn added inline comments.


================
Comment at: llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h:419
 ///
 /// Updates DT and LI if given.
 Instruction *SplitBlockAndInsertIfThen(Value *Cond, Instruction *SplitBefore,
----------------
Sounds like this needs updating, maybe something like `Updates the dominator tree via DTU and LI if given.`


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp:107
       getAnalysisIfAvailable<DominatorTreeWrapperPass>();
   DominatorTree *DT = DTW ? &DTW->getDomTree() : nullptr;
+  DomTreeUpdater DTU = DomTreeUpdater(DT, DomTreeUpdater::UpdateStrategy::Lazy);
----------------
nit: might be clearer to move this to the DomTreeUpdater initialization so it is clear that DT isn't used elsewhere?


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp:108
   DominatorTree *DT = DTW ? &DTW->getDomTree() : nullptr;
+  DomTreeUpdater DTU = DomTreeUpdater(DT, DomTreeUpdater::UpdateStrategy::Lazy);
 
----------------
nit: can just be ` DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Lazy);`? Same at other places.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149428



More information about the llvm-commits mailing list