[llvm-commits] [llvm] r53534 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-07-13-DivZero.ll test/Transforms/InstCombine/udiv_select_to_select_shift.ll

Chris Lattner clattner at apple.com
Tue Jul 15 09:55:43 PDT 2008


On Jul 15, 2008, at 12:34 AM, Duncan Sands wrote:

>>>> +    // If we found a call to a function, we can't assume it will
>>>> return, so
>>>> +    // information from below it cannot be propagated above it.
>>>> +    if (isa<CallInst>(BBI) && !isa<IntrinsicInst>(BBI))
>>>> +      break;
>>>
>>> I guess you only really need to exit here if SI is zero.
>
> Sorry, I confused SI with the original instruction I.

Ok

>  What I meant
> was that you always transform uses as long as they are below the
> original DivRem in the basic block; if they come before the DivRem
> then you have to be careful about calls that do not return.

I'm still not following.  The loop does a backwards walk from the div/ 
rem up, simplifying instructions as it goes.  If it find a call to a  
function that might not return, it stops simplifying.  Is there some  
way the loop can be made cleaner?

-Chris



More information about the llvm-commits mailing list