[PATCH] D26299: Improving the efficiency of the Loop Unswitching pass

Anna Thomas via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 10:05:51 PST 2016


anna added a comment.

Hi Abhilash, Michael,

One small suggestion inline from my side.

Thanks,
Anna



================
Comment at: lib/Transforms/Scalar/LoopUnswitch.cpp:509
+
+    if (DT->dominates(DT->getNode(UnreachableSucc), DT->getNode(BB)))
+      return true;
----------------
I was thinking of this signature in DominatorTree:
`dominates(BasicBlock*, BasicBlock*)`. 
So, the above changes to: `DT->dominates(UnreachableSucc, BB)`.

For other such usages, take a look in `LoopUnswitch::RewriteLoopBodyWithConditionConstant` function. 
```
if (Latch && DT->dominates(SISucc, Latch))
```
SISucc and Latch are both basic blocks.

For more clarification, check out Dominator class:
`class DominatorTree : public DominatorTreeBase<BasicBlock>`. The templatized `NodeT` is a basic block. 


Repository:
  rL LLVM

https://reviews.llvm.org/D26299





More information about the llvm-commits mailing list