[llvm-commits] [llvm] r122719 - in /llvm/trunk: include/llvm/InitializePasses.h include/llvm/Transforms/Scalar.h lib/Transforms/Scalar/CMakeLists.txt lib/Transforms/Scalar/LoopInstSimplify.cpp lib/Transforms/Scalar/Scalar.cpp

Cameron Zwarich zwarich at apple.com
Mon Jan 3 03:22:27 PST 2011


On 2011-01-03, at 2:30 AM, Duncan Sands wrote:

> Why do you require the dominator tree?  Starting from the header you can get all
> CFG successors by looping over the successors and visiting those.  By the very
> definition of dominance this will visit definitions before uses.  It is simple
> to check whether a basic block is in the loop using LoopInfo, so you can just
> skip the ones that aren't.  I guess there might be a problem with subloops if
> you want to skip those.

At the time I wanted to skip subloops, but that's just as easy to do without dominators. I'll switch to something simpler on the CFG alone.

>> +bool LoopInstSimplify::runOnLoop(Loop* L, LPPassManager&  LPM) {
>> +  DominatorTree* DT =&getAnalysis<DominatorTree>();
> 
> Usual style is a space before the * not after.

Is this true? I see both all over LLVM. I try to duplicate the style of whatever file I'm in, but when it's a new file I'm not sure which other style to emulate.

Cameron



More information about the llvm-commits mailing list