This reverts commit
b7c7fe3d0779b6e332fe6db64e87561deba2e56a.
As discussed in the planned follow-on to this patch (D138874),
this and the previous patch in this set can cause trouble for
the backend, and there's probably no quick fix. We may even
want to canonicalize in the opposite direction (towards insertelt).
unsigned NumEltsInScalar = ScalarWidth / VecEltWidth;
Value *X = T;
- if (IndexC == (IsBigEndian ? NumEltsInScalar - 1 : 0)) {
+ if ((IsBigEndian && IndexC == NumEltsInScalar - 1) ||
+ (!IsBigEndian && IndexC == 0)) {
// The insert is to the LSB end of the vector (depends on endian).
// That's all we need.
} else {