summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2016-10-13 21:03:49 +0000
committerTom Stellard <thomas.stellard@amd.com>2016-10-13 21:03:49 +0000
commitf80c1875a3b18ed668542daa5375c459f7bf9a03 (patch)
treeca7406e7b6246e9d5de71448d8a20def32bd7647 /llvm
parentc45025e7632459c61a989519125b1033d6593389 (diff)
downloadbcm5719-llvm-f80c1875a3b18ed668542daa5375c459f7bf9a03.tar.gz
bcm5719-llvm-f80c1875a3b18ed668542daa5375c459f7bf9a03.zip
LegalizeDAG: Implement PROMOTE for ISD::BITREVERSE
Summary: This operation is promoted the same way was ISD::BSWAP. This will prevent a regression in test/Target/AMDGOU/bitreverse.ll when i16 support is implemented. Reviewers: bogner, hfinkel Subscribers: hfinkel, wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D25202 llvm-svn: 284163
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index db24d9651b3..a0c80976c1a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -4084,10 +4084,11 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node) {
}
Results.push_back(DAG.getNode(ISD::TRUNCATE, dl, OVT, Tmp1));
break;
+ case ISD::BITREVERSE:
case ISD::BSWAP: {
unsigned DiffBits = NVT.getSizeInBits() - OVT.getSizeInBits();
Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, dl, NVT, Node->getOperand(0));
- Tmp1 = DAG.getNode(ISD::BSWAP, dl, NVT, Tmp1);
+ Tmp1 = DAG.getNode(Node->getOpcode(), dl, NVT, Tmp1);
Tmp1 = DAG.getNode(
ISD::SRL, dl, NVT, Tmp1,
DAG.getConstant(DiffBits, dl,
OpenPOWER on IntegriCloud