[llvm-commits] [llvm] r85738 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/phi.ll

Chris Lattner clattner at apple.com
Mon Nov 2 19:40:06 PST 2009


On Nov 2, 2009, at 6:23 AM, Duncan Sands wrote:

> Hi Chris,
>
>> -    LoadAlignment = std::max(LoadAlignment, LI->getAlignment());
>> +    LoadAlignment = std::min(LoadAlignment, LI->getAlignment());
>
> if one alignment is zero and the other is not, then zero (the  
> minimum) may
> be the wrong result.  On the other hand, if one is zero and the  
> other is
> over aligned (bigger than the ABI alignment), then zero is the right  
> thing,
> not the bigger alignment.  You need target data to get this right.

The transformation explicitly does not transform the case when some  
loads have an alignment specified and others do.  It only xforms when  
all are specified or none are.

-Chris



More information about the llvm-commits mailing list