[llvm] r233447 - [SCEV] Look at backedge dominating conditions.

Daniel Berlin dberlin at dberlin.org
Mon Mar 30 14:54:53 PDT 2015


The isSingleEdge() call you make in this patch will be linear time, sadly ;(

(This is another case you really want to know control regions)

On Mon, Mar 30, 2015 at 2:38 PM, Sanjoy Das
<sanjoy at playingwithpointers.com> wrote:
> Hi Daniel,
>
> It tried compiling all *.cpp files in llvm/lib/Analysis/ (just as a
> corpus of interesting C++ code) with -fsanitize=memory, and did not
> see any visible difference between the change reverted vs. the change
> unreverted.  I'll find it very helpful if you can please send me a
> sample cpp/c file (preprocessed preferably) that exhibits the
> compile-time issue you mention -- there are many things that could be
> going wrong and I don't want to waste too much time "fixing" the wrong
> issue. :)
>
> Having said that, if you have a way to easily reproduce the problem,
> can you please try applying the attached patch and check if you still
> see excessively slow compiles?  The fix is an almost blind guess, but
> it might just do the trick.
>
>> The root cause seems to be the repeated recursion:
>>
>> ...
>> llvm::ScalarEvolution::getZeroExtendExpr(llvm::SCEV const*, llvm::Type*) ()
>> llvm::ScalarEvolution::isImpliedCond(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::Value*, bool) ()
>> llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(llvm::Loop const*, llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV > const*) ()
>> llvm::ScalarEvolution::getZeroExtendExpr(llvm::SCEV const*, llvm::Type*) ()
>> llvm::ScalarEvolution::isImpliedCond(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::Value*, bool) ()
>> llvm::ScalarEvolution::isLoopBackedgeGuardedByCond(llvm::Loop const*, llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV > const*) ()
>> ...
>
> By repeated do you mean the recursion itself is too deeply nested?  Or
> that you repeatedly see this pattern on the stack?
>
> Thanks,
> -- Sanjoy
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list