diff options
| author | Craig Topper <craig.topper@gmail.com> | 2013-01-18 08:41:28 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2013-01-18 08:41:28 +0000 |
| commit | 1cb8aa581bc8f330789bef564120e8ba768e905b (patch) | |
| tree | d5bf8270b67446d272fec5c58068a6a698d7913f /llvm/lib/Target/X86/X86ISelLowering.cpp | |
| parent | e938138daf5e45b0e40532d417eb2c3d4b0d9c30 (diff) | |
| download | bcm5719-llvm-1cb8aa581bc8f330789bef564120e8ba768e905b.tar.gz bcm5719-llvm-1cb8aa581bc8f330789bef564120e8ba768e905b.zip | |
Calculate vector element size more directly for VINSERTF128/VEXTRACTF128 immediate handling. Also use MVT since this only called on legal types during pattern matching.
llvm-svn: 172797
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 4d982a40216..2b6ff3602a4 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -4011,9 +4011,8 @@ bool X86::isVEXTRACTF128Index(SDNode *N) { uint64_t Index = cast<ConstantSDNode>(N->getOperand(1).getNode())->getZExtValue(); - unsigned VL = N->getValueType(0).getVectorNumElements(); - unsigned VBits = N->getValueType(0).getSizeInBits(); - unsigned ElSize = VBits / VL; + MVT VT = N->getValueType(0).getSimpleVT(); + unsigned ElSize = VT.getVectorElementType().getSizeInBits(); bool Result = (Index * ElSize) % 128 == 0; return Result; @@ -4030,9 +4029,8 @@ bool X86::isVINSERTF128Index(SDNode *N) { uint64_t Index = cast<ConstantSDNode>(N->getOperand(2).getNode())->getZExtValue(); - unsigned VL = N->getValueType(0).getVectorNumElements(); - unsigned VBits = N->getValueType(0).getSizeInBits(); - unsigned ElSize = VBits / VL; + MVT VT = N->getValueType(0).getSimpleVT(); + unsigned ElSize = VT.getVectorElementType().getSizeInBits(); bool Result = (Index * ElSize) % 128 == 0; return Result; |

