linearizing aggregates

   I would like to address aggregates (structures, arrays) in a
linear fashion and in terms of the simplest target type that is
embedded in these data structures, So a 2 dimensional array becomes
a single dimension array. A structure with a character and array is
addressed in terms of the target size of character. So hopefully
express the
address calculation in terms of one GEP(base, offset) or if GEP cant
express it use my intrinsic.
Is that feasible ? If so, can that be done as a bc transformation or
would be possible to do it earlier. ?