diff options
author | Craig Topper <craig.topper@sifive.com> | 2024-08-16 09:21:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-16 09:21:11 -0700 |
commit | 7afb51e035709e7f2532452054a39fe968444504 (patch) | |
tree | f4884eac4c235c7d1643f443aa3d9d575339546b /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | 1164e4aef2844ac3d35153ffe6376db9abda704a (diff) | |
download | llvm-7afb51e035709e7f2532452054a39fe968444504.zip llvm-7afb51e035709e7f2532452054a39fe968444504.tar.gz llvm-7afb51e035709e7f2532452054a39fe968444504.tar.bz2 |
[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.
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index c1a87de..3c499ca 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -6349,9 +6349,9 @@ SDValue TargetLowering::BuildSDIV(SDNode *N, SelectionDAG &DAG, } MagicFactors.push_back(DAG.getConstant(magics.Magic, dl, SVT)); - Factors.push_back(DAG.getConstant(NumeratorFactor, dl, SVT)); + Factors.push_back(DAG.getSignedConstant(NumeratorFactor, dl, SVT)); Shifts.push_back(DAG.getConstant(magics.ShiftAmount, dl, ShSVT)); - ShiftMasks.push_back(DAG.getConstant(ShiftMask, dl, SVT)); + ShiftMasks.push_back(DAG.getSignedConstant(ShiftMask, dl, SVT)); return true; }; |