I've always found the "findValue" a little odd and
inconsistent with other things in SDB.
This simplies the code in SDB to just handle a splat constant
address or a 2 operand GEP in the same BB. This removes the
need for "findValue" since the operands to the GEP are
guaranteed to be available. The splat constant handling is
new, but was needed to avoid regressions due to constant
folding combining GEPs created in CGP.
CGP is now responsible for canonicalizing gather/scatters into
this form. The pattern I'm using for scalarizing, a scalar GEP
followed by a GEP with an all zeroes index, seems to be subject
to constant folding that the insertelement+shufflevector was not.
I haven't looked at this before, so I'm not the best reviewer...
But it would be helpful to any first-time reader if this function had a documentation comment to describe the transform. An IR example in the comment and IR regression tests would also be educational.