> Is there any standard pass or something that can fuse chained GEPIs? > > I.e. turning > b = getelementptr a, 10, 1 > c = getelementptr b, 0, 3 > d = getelementptr c, 0, 5 > into: > d = getelementptr a, 10, 1, 3, 5 I think instcombine does this. Ciao, Duncan.