From 246c236ff9761920f5098878aba651e2112618bf Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 12 Aug 2024 16:26:28 +0200 Subject: [PATCH] [ConstantFolding] Use getSigned() Split out from https://github.com/llvm/llvm-project/pull/80309. --- llvm/lib/Analysis/ConstantFolding.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index 084647b1d9d938..defcacdfa8b105 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/lib/Analysis/ConstantFolding.cpp @@ -3400,8 +3400,9 @@ ConstantFoldScalarFrexpCall(Constant *Op, Type *IntTy) { // The exponent is an "unspecified value" for inf/nan. We use zero to avoid // using undef. - Constant *Result1 = FrexpMant.isFinite() ? ConstantInt::get(IntTy, FrexpExp) - : ConstantInt::getNullValue(IntTy); + Constant *Result1 = FrexpMant.isFinite() + ? ConstantInt::getSigned(IntTy, FrexpExp) + : ConstantInt::getNullValue(IntTy); return {Result0, Result1}; }