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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 00:55:43 PDT 2024


================
@@ -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,
----------------
nikic wrote:

Doing that is exactly how most i128 miscompiles get introduced ;) Note that getConstant() performs a zero extension, not a sign extension.

https://github.com/llvm/llvm-project/pull/102995


More information about the llvm-commits mailing list