Index: llvm/trunk/lib/Transforms/Scalar/LICM.cpp =================================================================== --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp @@ -945,15 +945,16 @@ // instruction will be executed, update the alignment. // Larger is better, with the exception of 0 being the best alignment. unsigned InstAlignment = Store->getAlignment(); - if ((InstAlignment > Alignment || InstAlignment == 0) && Alignment != 0) + if ((InstAlignment > Alignment || InstAlignment == 0) && + Alignment != 0) { if (isGuaranteedToExecute(*UI, DT, CurLoop, SafetyInfo)) { GuaranteedToExecute = true; Alignment = InstAlignment; } - - if (!GuaranteedToExecute) + } else if (!GuaranteedToExecute) { GuaranteedToExecute = isGuaranteedToExecute(*UI, DT, CurLoop, SafetyInfo); + } if (!GuaranteedToExecute && !CanSpeculateLoad) { CanSpeculateLoad = isDereferenceableAndAlignedPointer(