Hi, For the following test: svint32_t f(svint32_t v) { return svrev_s32 (svrev_s32 (v)); } We generate 2 rev instructions instead of nop: f: rev z0.s, z0.s rev z0.s, z0.s ret The attached patch tries to fix that by trying to recognize the following pattern in match.pd: v1 = VEC_PERM_EXPR (v0, v0, mask) v2 = VEC_PERM_EXPR (v1, v1, mask) --> v2 = v0 if mask is { nelts - 1, nelts - 2, nelts - 3, ... } Code-gen with patch: f: ret Bootstrap+test passes on aarch64-linux-gnu, and SVE bootstrap in progress. Does it look OK for stage-1 ? Thanks, Prathamesh