summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-05-20 09:42:31 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-05-20 09:42:31 +0000
commit7bd6bee3854a197b05a407bc839a5b5896999e0f (patch)
tree287de5e1919dfde6ef570fe2f0d236e8fea8f29d /llvm/lib/CodeGen
parent9cb4090867321104de405282ab9ec91116763e19 (diff)
downloadbcm5719-llvm-7bd6bee3854a197b05a407bc839a5b5896999e0f.tar.gz
bcm5719-llvm-7bd6bee3854a197b05a407bc839a5b5896999e0f.zip
Legalizer: Make bswap promotion safe for vectors.
llvm-svn: 209202
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index 1c5c9a2492b..2483184deed 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -268,9 +268,9 @@ SDValue DAGTypeLegalizer::PromoteIntRes_BSWAP(SDNode *N) {
EVT NVT = Op.getValueType();
SDLoc dl(N);
- unsigned DiffBits = NVT.getSizeInBits() - OVT.getSizeInBits();
+ unsigned DiffBits = NVT.getScalarSizeInBits() - OVT.getScalarSizeInBits();
return DAG.getNode(ISD::SRL, dl, NVT, DAG.getNode(ISD::BSWAP, dl, NVT, Op),
- DAG.getConstant(DiffBits, TLI.getPointerTy()));
+ DAG.getConstant(DiffBits, TLI.getShiftAmountTy(NVT)));
}
SDValue DAGTypeLegalizer::PromoteIntRes_BUILD_PAIR(SDNode *N) {
OpenPOWER on IntegriCloud