[llvm-commits] [llvm] r97126 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp lib/Transforms/Scalar/IndVarSimplify.cpp lib/Transforms/Utils/LoopSimplify.cpp test/CodeGen/X86/2009-09-07-CoalescerBug.ll test/Transforms/IndVarSimplify/2003-09-12-MultiplePred.ll test/Transforms/LoopDeletion/simplify-then-delete.ll

Dan Gohman gohman at apple.com
Thu Feb 25 11:58:34 PST 2010


On Feb 24, 2010, at 11:12 PM, Nick Lewycky wrote:

> Dan Gohman wrote:
>> Author: djg
>> Date: Thu Feb 25 00:57:05 2010
>> New Revision: 97126
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=97126&view=rev
>> Log:
>> Make LoopSimplify change conditional branches in loop exiting blocks
>> which branch on undef to branch on a boolean constant for the edge
>> exiting the loop. This helps ScalarEvolution compute trip counts for
>> loops.
>
> I'm confused. 'undef' is already a constant and ought to be more  
> useful for optimization than i1 0 or i1 1. Are you sure this is the  
> right fix?

If ScalarEvolution picks "false" and later JumpThreading, picks "true",
badness could ensue.  By modifying the branch, LoopSimplify
ensures that all subsequent passes will use the same decision.

Dan




More information about the llvm-commits mailing list