OSDN Git Service

DAG: Avoid bitcast/ext/build_vector combine
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 7 Jun 2018 19:42:27 +0000 (19:42 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 7 Jun 2018 19:42:27 +0000 (19:42 +0000)
commitb6ab0f18f8530aadefba0bde57f78fd44573f9da
tree4270a73717ed35bf1db9cf0225c42c37df735ce0
parent89be48cd836afc65a2d241a1ad78cac899dd356a
DAG: Avoid bitcast/ext/build_vector combine

This avoids regressions in a future AMDGPU change
to make v4i16/v4f16 legal. For these types, build_vector
is implemented as bitcasted operations on v2i32. This
combine was creating v4i16s out of what would have been
already been a v2i32 build_vector, creating a mess
of nodes that never get cleaned up.

I'm not sure this is the right condition to check.
I initially tried just checking for the legality of the
new build_vector. This works for my case, but breaks dozens
of x86 tests. A Mips test seems to show some improvement
or at least a neutral change. I don't want to think
about how long it would take to analyze the set of
different x86 vector operations impacted.

Test included in future commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334218 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp