[llvm] f58f92c - [SelectionDAG] Move SelectionDAG::getAllOnesConstant out of line. NFC (#102995)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 10:15:20 PDT 2024


Author: Craig Topper
Date: 2024-08-13T10:15:16-07:00
New Revision: f58f92c2138ed0b3e802d0c45ba3652e72e208c4

URL: https://github.com/llvm/llvm-project/commit/f58f92c2138ed0b3e802d0c45ba3652e72e208c4
DIFF: https://github.com/llvm/llvm-project/commit/f58f92c2138ed0b3e802d0c45ba3652e72e208c4.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/SelectionDAG.h
    llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/SelectionDAG.h b/llvm/include/llvm/CodeGen/SelectionDAG.h
index 1d0124ec75535..9ce3c48a7f76c 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 6ed77fc8d8f17..f9701b3ccbffa 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);


        


More information about the llvm-commits mailing list