[llvm] [SelectionDAG] Remove unneeded assert from SelectionDAG::getSignedConstant. NFC (PR #114336)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 30 17:49:05 PDT 2024
https://github.com/topperc created https://github.com/llvm/llvm-project/pull/114336
This assert is also present inside the APInt constructor after #106524, but its not yet enabled by default. So we also need to pass false to the implicitTrunc flag.
>From 8f9af2cd39aa421e8f0c8c8bc14e577af9277668 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Wed, 30 Oct 2024 17:38:09 -0700
Subject: [PATCH] [SelectionDAG] Remove unneeded assert from
SelectionDAG::getSignedConstant. NFC
This assert is also present inside the APInt constructor after #106524,
but its not yet enabled by default. So we also need to pass false
to the implicitTrunc flag.
---
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 5403d787861d46..dd701bcea14b6e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1772,10 +1772,9 @@ SDValue SelectionDAG::getConstant(const ConstantInt &Val, const SDLoc &DL,
SDValue SelectionDAG::getSignedConstant(int64_t Val, const SDLoc &DL, EVT VT,
bool isT, bool isO) {
unsigned Size = VT.getScalarSizeInBits();
- assert(
- isIntN(Size, Val) &&
- "getSignedConstant with a int64_t value that doesn't fit in the type!");
- return getConstant(APInt(Size, Val, true), DL, VT, isT, isO);
+ return getConstant(
+ APInt(Size, Val, /*isSigned=*/true, /*implicitTrunc=*/false), DL, VT, isT,
+ isO);
}
SDValue SelectionDAG::getAllOnesConstant(const SDLoc &DL, EVT VT, bool IsTarget,
More information about the llvm-commits
mailing list