[PATCH] D82566: [CodeMoverUtils] Make specific analysis dependent checks optional

Whitney Tsang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 13:08:42 PDT 2020


Whitney added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/CodeMoverUtils.cpp:100
+    const PostDominatorTree *PDT, unsigned MaxLookup) {
+  assert(DT->dominates(&Dominator, &BB) &&
+         "Expecting Dominator to dominate BB");
----------------
RithikSharma wrote:
> Whitney wrote:
> > you can a segfault here when DT is nullptr, making analyses optional means you have to add handle when they are nullptr, and add alternative ways to do what the function is intended to do.
> Acknowledged but right now ControlConditions or its member functions are not called when we don't have DT or PDT. ControlConditions don't know that DT and PDT are optional, isn't it be handled by ControlCondition's clients?  
in that case change the parameters back to references for ControlConditions


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82566





More information about the llvm-commits mailing list