Fixes a bug preventing moving the loop's metadata to an outer loop's header,
which happens if the loop's exit is also the header of an outer loop.
Adds a test for above.
Fixes #55416.
Differential D125574
[BasicBlockUtils] Do not move loop metadata if outer loop header. hgreving on May 13 2022, 11:47 AM. Authored by
Details Fixes a bug preventing moving the loop's metadata to an outer loop's header, Adds a test for above. Fixes #55416.
Diff Detail Event TimelineComment Actions Thanks for the patch! Makes sense, I added some suggestions with respect to the test.
This comment was removed by hgreving.
Comment Actions It looks like the patch was landed but the commit message seems a bit out-of-sync with the code.it
Comment Actions Sorry I missed that request, but I had left it intentionally, the patch still does not move, but copies.
Would you like me to amend? |
So the interesting case is when the original latch is shared between multiple loops. At the moment, we move the metadata to the new latch of the outer loop. With this patch we keep it at the latch of the inneer loop, which won't be the latch of the outer loop any longer.
I am not sure if either option is more correct/better than the other.
Should we duplicate the metadata and add it to the new latches of both loops? This would be in line with the original IR, where the metadata applied to both loops.