Deleted Added
full compact
1163,1169d1162
< // Early exit if this basic block is in an optnone function.
< AttributeSet FnAttrs =
< DAG.getMachineFunction().getFunction()->getAttributes();
< if (FnAttrs.hasAttribute(AttributeSet::FunctionIndex,
< Attribute::OptimizeNone))
< return;
<
2791,2793c2784,2790
< Constant = APInt::getAllOnesValue(BitWidth);
< for (unsigned i = 0, n = SplatBitSize/BitWidth; i < n; ++i)
< Constant &= SplatValue.lshr(i*BitWidth).zextOrTrunc(BitWidth);
---
> // Make sure that variable 'Constant' is only set if 'SplatBitSize' is a
> // multiple of 'BitWidth'. Otherwise, we could propagate a wrong value.
> if (SplatBitSize % BitWidth == 0) {
> Constant = APInt::getAllOnesValue(BitWidth);
> for (unsigned i = 0, n = SplatBitSize/BitWidth; i < n; ++i)
> Constant &= SplatValue.lshr(i*BitWidth).zextOrTrunc(BitWidth);
> }
11046c11043,11045
< if (VecIn2.getNode())
---
> // If the zero vector was used, we can not split the vector,
> // since we'd need 3 inputs.
> if (UsesZeroVector || VecIn2.getNode())
11058d11056
< UsesZeroVector = false;