https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101895
--- Comment #3 from Jeffrey A. Law <law at gcc dot gnu.org> --- Understood WRT phase ordering. That was fully expected. What I still don't understand is why moving the permute down is profitable here or generally why moving a permute into a dependency chain is profitable. ISTM that hoisting a permute up a dependency chain so that it's fed by a load is profitable. Similarly sinking a permute to the end of a dependency chain so that it feeds a store is profitable. Moving a permute so that it feeds or is fed by another permute is probably profitable too. Otherwise moving a permute into the middle of a dependency chain seems like a pessimization.