Skip to content

Commit f58f92c

Browse files
authored
[SelectionDAG] Move SelectionDAG::getAllOnesConstant out of line. NFC (#102995)
This function has to get the scalar size and create an APInt. I don't think it belongs inline.
1 parent dbe8a10 commit f58f92c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

llvm/include/llvm/CodeGen/SelectionDAG.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,10 +675,7 @@ class SelectionDAG {
675675
bool isTarget = false, bool isOpaque = false);
676676

677677
SDValue getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget = false,
678-
bool IsOpaque = false) {
679-
return getConstant(APInt::getAllOnes(VT.getScalarSizeInBits()), DL, VT,
680-
IsTarget, IsOpaque);
681-
}
678+
bool IsOpaque = false);
682679

683680
SDValue getConstant(const ConstantInt &Val, const SDLoc &DL, EVT VT,
684681
bool isTarget = false, bool isOpaque = false);

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,6 +1748,12 @@ SDValue SelectionDAG::getConstant(const ConstantInt &Val, const SDLoc &DL,
17481748
return Result;
17491749
}
17501750

1751+
SDValue SelectionDAG::getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget,
1752+
bool IsOpaque) {
1753+
return getConstant(APInt::getAllOnes(VT.getScalarSizeInBits()), DL, VT,
1754+
IsTarget, IsOpaque);
1755+
}
1756+
17511757
SDValue SelectionDAG::getIntPtrConstant(uint64_t Val, const SDLoc &DL,
17521758
bool isTarget) {
17531759
return getConstant(Val, DL, TLI->getPointerTy(getDataLayout()), isTarget);

0 commit comments

Comments
 (0)