Make MachineLICM PostRA (or PreRa) work only on the inner loop for a loop nest

     I am curious if I can make the MachineLICM transformation work only on the inner loop when it encounters a loop nest in the program.

     I've started examining the source code of the pass - . I found comments like <<// If this is done before regalloc, only visit outer-most preheader-sporting // loops>>.
     I'll come back if I find a solution.

   Thank you very much,

     I found a solution to this problem I asked about - make MachineLICM pre-RA (or post-RA, in principle) work only on the inner loop for a loop nest. Basically, I had to change the code of MachineLICM.cpp, by adding in method
       MachineLICM::HoistOutOfLoop(MachineDomTreeNode *HeaderN)
     in the loop:
       for (MachineDomTreeNode *Node : Scopes) {
         MachineBasicBlock *MBB = Node->getBlock();
   some extra code that checks if MBB has name "vector.body", which is the inner loop that I care about, and in such case I set Preheader variable defined there to be the predecessor of vector.body, normally called "".
     If you want I can provide the exact code patch.

     Since these are the only cases I care about, namely loops (or loop nests) resulted from the LoopVectorize LLVM module, this small patch serves well.

     So, I could not employ the command-line arguments of llc and had to adapt the code of the MachineLICM pass.

   Best regards,