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)
commit6fec24744f805f1c353a580e81cb8a4d2be70013
tree39ebb7b82ddcaa7aa9d0d2b43b1007cf8d35c867
parent463734499ec45023ec9f5c02b23d454596d3095a
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230560 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineVectorOps.cpp
test/Transforms/InstCombine/type_pun.ll [new file with mode: 0644]