InstCombine: extract instead of shuffle when performing vector/array type punning
authorJF Bastien <jfb@google.com>
Wed, 25 Feb 2015 22:30:51 +0000 (22:30 +0000)
committerJF Bastien <jfb@google.com>
Wed, 25 Feb 2015 22:30:51 +0000 (22:30 +0000)
commitd52c990a9063c266733677e9de3598883a592da0
treeb16dabb3f5aac31f71ad434e095712cb130634e7
parentde3743453fb7ef45eca9d99ba4f9b1da70135f28
InstCombine: extract instead of shuffle when performing vector/array type punning

Summary: SROA generates code that isn't quite as easy to optimize and contains unusual-sized shuffles, but that code is generally correct. As discussed in D7487 the right place to clean things up is InstCombine, which will pick up the type-punning pattern and transform it into a more obvious bitcast+extractelement, while leaving the other patterns SROA encounters as-is.

Test Plan: make check

Reviewers: jvoung, chandlerc

Subscribers: llvm-commits
llvm-svn: 230560
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
llvm/test/Transforms/InstCombine/type_pun.ll [new file with mode: 0644]