[llvm] [DAG] Add SelectionDAG::getShiftAmountConstant APInt variant (PR #81484)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 12 19:57:20 PST 2024
================
@@ -2824,25 +2824,26 @@ void DAGTypeLegalizer::ExpandShiftByConstant(SDNode *N, const APInt &Amt,
EVT NVT = InL.getValueType();
unsigned VTBits = N->getValueType(0).getSizeInBits();
unsigned NVTBits = NVT.getSizeInBits();
- EVT ShTy = N->getOperand(1).getValueType();
if (N->getOpcode() == ISD::SHL) {
if (Amt.uge(VTBits)) {
Lo = Hi = DAG.getConstant(0, DL, NVT);
} else if (Amt.ugt(NVTBits)) {
Lo = DAG.getConstant(0, DL, NVT);
- Hi = DAG.getNode(ISD::SHL, DL,
- NVT, InL, DAG.getConstant(Amt - NVTBits, DL, ShTy));
----------------
arsenm wrote:
I'd generally expect transforms to try to preserve the existing shift operand type?
https://github.com/llvm/llvm-project/pull/81484
More information about the llvm-commits
mailing list