compiler: remove flattening pass