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

Duncan Sands baldrick at free.fr
Mon Nov 2 06:23:47 PST 2009


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.

Ciao,

Duncan.



More information about the llvm-commits mailing list