From 7afb51e035709e7f2532452054a39fe968444504 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 16 Aug 2024 09:21:11 -0700 Subject: [SelectionDAG][X86] Add SelectionDAG::getSignedConstant and use it in a few places. (#104555) PR #80309 proposes to have users of APInt's uint64_t constructor opt-in to implicit truncation. Currently, that patch requires SelectionDAG::getConstant to opt-in. This patch adds getSignedConstant so we can start fixing some of the cases that require implicit truncation. --- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index e7f7653..debecc4 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -2601,7 +2601,7 @@ SDValue SelectionDAGLegalize::expandFrexp(SDNode *Node) const { SDValue IsDenormal = DAG.getSetCC(dl, SetCCVT, Abs, SmallestNormalizedInt, ISD::SETULT); - SDValue MinExp = DAG.getConstant(MinExpVal, dl, ExpVT); + SDValue MinExp = DAG.getSignedConstant(MinExpVal, dl, ExpVT); SDValue Zero = DAG.getConstant(0, dl, ExpVT); SDValue ScaledAsInt = DAG.getNode(ISD::BITCAST, dl, AsIntVT, ScaleUp); -- cgit v1.1