diff options
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index a0f4c49..2a8bda5 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -12644,6 +12644,18 @@ bool llvm::isAllOnesOrAllOnesSplat(SDValue N, bool AllowUndefs) { return C && C->isAllOnes() && C->getValueSizeInBits(0) == BitWidth; } +bool llvm::isOnesOrOnesSplat(SDValue N, bool AllowUndefs) { + ConstantSDNode *C = isConstOrConstSplat(N, AllowUndefs); + return C && APInt::isSameValue(C->getAPIntValue(), + APInt(C->getAPIntValue().getBitWidth(), 1)); +} + +bool llvm::isZeroOrZeroSplat(SDValue N, bool AllowUndefs) { + N = peekThroughBitcasts(N); + ConstantSDNode *C = isConstOrConstSplat(N, AllowUndefs, true); + return C && C->isZero(); +} + HandleSDNode::~HandleSDNode() { DropOperands(); } |