diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-05-12 13:22:12 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-05-12 13:22:12 +0000 |
commit | f01c301f725c031d59c66bb6bc3ad87656a1044f (patch) | |
tree | b2007ec201351e6017eb067309f949c300b61d3c /llvm/lib/CodeGen | |
parent | a6ed1b2f129950513ced589f9d4f8ee32f7378d9 (diff) | |
download | bcm5719-llvm-f01c301f725c031d59c66bb6bc3ad87656a1044f.tar.gz bcm5719-llvm-f01c301f725c031d59c66bb6bc3ad87656a1044f.zip |
[DAGCombine] Use SelectionDAG::getZExtOrTrunc helper. NFCI.
llvm-svn: 302897
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 69678da7ad7..3ef34bfc61e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -7361,14 +7361,8 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) { N0.getValueSizeInBits(), std::min(Op.getValueSizeInBits(), VT.getSizeInBits())); - if (TruncatedBits.isSubsetOf(Known.Zero)) { - if (VT.bitsGT(Op.getValueType())) - return DAG.getNode(ISD::ZERO_EXTEND, SDLoc(N), VT, Op); - if (VT.bitsLT(Op.getValueType())) - return DAG.getNode(ISD::TRUNCATE, SDLoc(N), VT, Op); - - return Op; - } + if (TruncatedBits.isSubsetOf(Known.Zero)) + return DAG.getZExtOrTrunc(Op, SDLoc(N), VT); } // fold (zext (truncate (load x))) -> (zext (smaller load x)) |