-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[SelectionDAG] Remove unneeded assert from SelectionDAG::getSignedConstant. NFC #114336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…stant. NFC This assert is also present inside the APInt constructor after llvm#106524, but its not yet enabled by default. So we also need to pass false to the implicitTrunc flag.
@llvm/pr-subscribers-llvm-selectiondag Author: Craig Topper (topperc) ChangesThis 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. Full diff: https://github.com/llvm/llvm-project/pull/114336.diff 1 Files Affected:
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,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though the implicitTrunc=false
is no longer needed now that #114539 has landed again (and it looks like it is sticking this time).
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/52/builds/3466 Here is the relevant piece of the build log for the reference
|
…stant. NFC (llvm#114336) This assert is also present inside the APInt constructor after llvm#114539.
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.