diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2018-01-31 23:54:16 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2018-01-31 23:54:16 +0000 |
commit | df0f25070cb66c7d8b92bcc198c7bf842ba56b1d (patch) | |
tree | 46e65f5cc21994ed66d7ac0c64cc5610ae7cce40 /llvm/lib | |
parent | 8f6d2def2b7f8440632fbdbe85d59b70399257a3 (diff) | |
download | bcm5719-llvm-df0f25070cb66c7d8b92bcc198c7bf842ba56b1d.tar.gz bcm5719-llvm-df0f25070cb66c7d8b92bcc198c7bf842ba56b1d.zip |
DAG: Fix not truncating when promoting bswap/bitreverse
These need to convert back to the original type, like any
other promotion.
llvm-svn: 323932
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 76aedfec2f8..e59c664fd8b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -4300,7 +4300,8 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node) { ISD::SRL, dl, NVT, Tmp1, DAG.getConstant(DiffBits, dl, TLI.getShiftAmountTy(NVT, DAG.getDataLayout()))); - Results.push_back(Tmp1); + + Results.push_back(DAG.getNode(ISD::TRUNCATE, dl, OVT, Tmp1)); break; } case ISD::FP_TO_UINT: |