TargetLowering: Fix getTypeConversion handling of extended vector types
authorArnold Schwaighofer <aschwaighofer@apple.com>
Sun, 7 Apr 2013 20:22:56 +0000 (20:22 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Sun, 7 Apr 2013 20:22:56 +0000 (20:22 +0000)
commitcd3d60c4505efad809a3d8b4ba9aed315568f8d8
treeb2c693de3c8970350de1585f3c608a8824768169
parent8764c8979c66966b5af62a0a316acead47c038cd
TargetLowering: Fix getTypeConversion handling of extended vector types

The code in getTypeConversion attempts to promote the element vector type
before it trys to split or widen the vector.
After it failed finding a legal vector type by promoting it would continue using
the promoted vector element type. Thereby missing legal splitted vector types.
For example the type v32i32 that has a legal split of 4 x v3i32 on x86/sse2
would be transformed to: v32i256 and from there on successively split to:
v16i256, v8i256, v1i256 and then finally ends up as an i64 type.
By resetting the vector element type to the original vector element type that
existed before the promotion the code will attempt to split the vector type to
smaller vector widths of the same type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178999 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetLowering.h
test/Analysis/CostModel/X86/testshiftashr.ll
test/Analysis/CostModel/X86/testshiftlshr.ll
test/Analysis/CostModel/X86/testshiftshl.ll