diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-06-07 18:07:06 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-06-07 18:07:06 +0000 |
commit | 4c9db2045a50e9afcc8196d4269d3092cb72d0c4 (patch) | |
tree | d40a0426911e8bc6ce817287cf6b6defa1dee4a2 | |
parent | 02828985868ca5c9788824077d74a6d674a686e2 (diff) | |
download | bcm5719-llvm-4c9db2045a50e9afcc8196d4269d3092cb72d0c4.tar.gz bcm5719-llvm-4c9db2045a50e9afcc8196d4269d3092cb72d0c4.zip |
[DAGCombine] Use APInt::extractBits in "sub-splat" constant mask detection. NFCI.
llvm-svn: 362820
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index f78f775017a..696de2c575d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -5005,10 +5005,10 @@ SDValue DAGCombiner::visitAND(SDNode *N) { // Make sure that variable 'Constant' is only set if 'SplatBitSize' is a // multiple of 'BitWidth'. Otherwise, we could propagate a wrong value. - if (SplatBitSize % BitWidth == 0) { + if ((SplatBitSize % BitWidth) == 0) { Constant = APInt::getAllOnesValue(BitWidth); - for (unsigned i = 0, n = SplatBitSize/BitWidth; i < n; ++i) - Constant &= SplatValue.lshr(i*BitWidth).zextOrTrunc(BitWidth); + for (unsigned i = 0, n = (SplatBitSize / BitWidth); i < n; ++i) + Constant &= SplatValue.extractBits(BitWidth, i * BitWidth); } } } |