Hi, I'm trying to add a pass to gcc to implement structure splitting/peeling. Basically like the code below: // origin structures: struct reg { // other fields struct node *nodes; // other fields } struct node { xxx field1; xxx field2; } // after splitting: struct reg_split { // other fields xxx *filed1; xxx *filed2; // other fields } In some cases like 462.libquantum in SPEC-CPU2006, the filed1 is hardly visited by functions, and field2 is much more popular. To make the cache happy, the structure needs to be split. But I'm not so familiar with gcc, so I'm writing this email for some comprehensive advice to help me achieve that. I put my pass at ipa-late-pass recently, I don't know if it is a good place. And I'm trying to make it through these steps: * analyze the code to find structure types that need to be split * find the allocate functions that init the structure * visit all the functions to find the structure type and split it I'm now trying to start with step3. And I'm handling gimple right now, I don't know how to change the origin gimple to the new gimple that I wished it to be. May I have some examples? Thanks so much.