diff options
| author | Craig Topper <craig.topper@gmail.com> | 2017-04-03 16:34:59 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2017-04-03 16:34:59 +0000 |
| commit | d33ee1b960fb29201da97d3af9a662f4ec1a3bff (patch) | |
| tree | cb797c08f831dcee02a76726af80c44e4dc91e00 /llvm/lib/Target/X86 | |
| parent | 9daf9c047d190d2bce09d966697d18eea1624a09 (diff) | |
| download | bcm5719-llvm-d33ee1b960fb29201da97d3af9a662f4ec1a3bff.tar.gz bcm5719-llvm-d33ee1b960fb29201da97d3af9a662f4ec1a3bff.zip | |
[APInt] Move isMask and isShiftedMask out of APIntOps and into the APInt class. Implement them without memory allocation for multiword
This moves the isMask and isShiftedMask functions to be class methods. They now use the MathExtras.h function for single word size and leading/trailing zeros/ones or countPopulation for the multiword size. The previous implementation made multiple temorary memory allocations to do the bitwise arithmetic operations to match the MathExtras.h implementation.
Differential Revision: https://reviews.llvm.org/D31565
llvm-svn: 299362
Diffstat (limited to 'llvm/lib/Target/X86')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 57d8139acba..b01fcc90823 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -31532,7 +31532,7 @@ static SDValue combineAndMaskToShift(SDNode *N, SelectionDAG &DAG, APInt SplatVal; if (!ISD::isConstantSplatVector(Op1.getNode(), SplatVal) || - !APIntOps::isMask(SplatVal)) + !SplatVal.isMask()) return SDValue(); if (!SupportedVectorShiftWithImm(VT0.getSimpleVT(), Subtarget, ISD::SRL)) @@ -32127,7 +32127,7 @@ static SDValue detectUSatPattern(SDValue In, EVT VT) { if (ISD::isConstantSplatVector(In.getOperand(1).getNode(), C)) { // C should be equal to UINT32_MAX / UINT16_MAX / UINT8_MAX according // the element size of the destination type. - return APIntOps::isMask(VT.getScalarSizeInBits(), C) ? In.getOperand(0) : + return C.isMask(VT.getScalarSizeInBits()) ? In.getOperand(0) : SDValue(); } return SDValue(); |

