[llvm-commits] [llvm] r58673 - in /llvm/trunk: include/llvm/CodeGen/Passes.h lib/CodeGen/LLVMTargetMachine.cpp lib/CodeGen/StackProtector.cpp

Bill Wendling isanbard at gmail.com
Tue Nov 4 15:59:35 PST 2008


On Tue, Nov 4, 2008 at 5:28 AM, Chris Lattner <clattner at apple.com> wrote:
>> +  PM.add(createStackProtectorPass(EnableStackProtector));
>
> Why do you add the pass even when it is not enabled?  Have you looked
> at whether adding this pass ends up breaking analysis chains, and
> requiring them to be run multiple times?  For example, does dominators
> end up being run more frequently with this?  If so, the pass should
> update dominators instead of invalidating it.
>
I looked at --debug-pass=Details with stack protectors and without.
There doesn't seem to be a difference in the two analyses. I'll test
more on other programs to make sure. I'm trying to do this late in the
game -- right before DAG conversion -- so that LLVM IR passes won't be
affected too much.

> Two things: first, use I->getTerminator.  Second, why do you make a
> vector of returns and iterate over the vector?  You should be able to
> handle all of these with one pass over the function without the
> intermediate vector.  Also, F->size() is linear time, so that itself
> does a pass over the function.
>
I simplified the code. But it still looks like modifying the function
while iterating over it is doing badness (it went into an infinite
loop on me when I tried it out). What did you have in mind?

-bw



More information about the llvm-commits mailing list