From f58f92c2138ed0b3e802d0c45ba3652e72e208c4 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 13 Aug 2024 10:15:16 -0700 Subject: [PATCH] [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. --- llvm/include/llvm/CodeGen/SelectionDAG.h | 5 +---- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/CodeGen/SelectionDAG.h b/llvm/include/llvm/CodeGen/SelectionDAG.h index 1d0124ec7553529..9ce3c48a7f76cb6 100644 --- a/llvm/include/llvm/CodeGen/SelectionDAG.h +++ b/llvm/include/llvm/CodeGen/SelectionDAG.h @@ -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); diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 6ed77fc8d8f1790..f9701b3ccbffae9 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -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);