Skip to content

Commit

Permalink
[SelectionDAG] Move SelectionDAG::getAllOnesConstant out of line. NFC (
Browse files Browse the repository at this point in the history
…#102995)

This function has to get the scalar size and create an APInt. I don't
think it belongs inline.
  • Loading branch information
topperc committed Aug 13, 2024
1 parent dbe8a10 commit f58f92c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 1 addition & 4 deletions llvm/include/llvm/CodeGen/SelectionDAG.h
Original file line number Diff line number Diff line change
Expand Up @@ -675,10 +675,7 @@ class SelectionDAG {
bool isTarget = false, bool isOpaque = false);

SDValue getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget = false,
bool IsOpaque = false) {
return getConstant(APInt::getAllOnes(VT.getScalarSizeInBits()), DL, VT,
IsTarget, IsOpaque);
}
bool IsOpaque = false);

SDValue getConstant(const ConstantInt &Val, const SDLoc &DL, EVT VT,
bool isTarget = false, bool isOpaque = false);
Expand Down
6 changes: 6 additions & 0 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,12 @@ SDValue SelectionDAG::getConstant(const ConstantInt &Val, const SDLoc &DL,
return Result;
}

SDValue SelectionDAG::getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget,
bool IsOpaque) {
return getConstant(APInt::getAllOnes(VT.getScalarSizeInBits()), DL, VT,
IsTarget, IsOpaque);
}

SDValue SelectionDAG::getIntPtrConstant(uint64_t Val, const SDLoc &DL,
bool isTarget) {
return getConstant(Val, DL, TLI->getPointerTy(getDataLayout()), isTarget);
Expand Down

0 comments on commit f58f92c

Please sign in to comment.