https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88605
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2019-01-02 CC| |rguenth at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- I agree we should try to optimize this patterns. Note we have proper tree codes for this but they are currently only emitted by the vectorizer because expansion only works when target support is available. Patterns to detect are a bit awkward thus our kitchen-sink forwprop pass is the place to implement this pattern matching: vconvert_u64_u32 (U32x2 v) { unsigned int _1; long long unsigned int _2; unsigned int _3; long long unsigned int _4; U64x2 _6; <bb 2> [local count: 1073741825]: _1 = BIT_FIELD_REF <v_7(D), 32, 0>; _2 = (long long unsigned int) _1; _3 = BIT_FIELD_REF <v_7(D), 32, 32>; _4 = (long long unsigned int) _3; _6 = {_2, _4}; return _6; so the keying should be on the CONSTRUCTORs (watch out for constants eventually propagated...). See simplify_vector_constructor which currently tries to detect a permutation only. Enhancing that to handle an intermediate conversion shouldn't be too difficult (it already seems to handle a few cases but not widening/shortening ones). There might be duplicates of this bug...