[llvm] 89e7e59 - [RISCV] Use the VT passed into selectImm instead of XLenVT. NFCI
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 30 11:16:42 PDT 2022
Author: Craig Topper
Date: 2022-06-30T11:15:28-07:00
New Revision: 89e7e59621bfd899beaac76f9066e731df5e6d20
URL: https://github.com/llvm/llvm-project/commit/89e7e59621bfd899beaac76f9066e731df5e6d20
DIFF: https://github.com/llvm/llvm-project/commit/89e7e59621bfd899beaac76f9066e731df5e6d20.diff
LOG: [RISCV] Use the VT passed into selectImm instead of XLenVT. NFCI
I think the VT pased in will always be XLen.
Added:
Modified:
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
index 74dda1fe6e91c..0bb78436d1903 100644
--- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
@@ -189,27 +189,26 @@ static bool hasMemOffset(SDNode *N, unsigned &BaseOpIdx,
static SDNode *selectImm(SelectionDAG *CurDAG, const SDLoc &DL, const MVT VT,
int64_t Imm, const RISCVSubtarget &Subtarget) {
- MVT XLenVT = Subtarget.getXLenVT();
RISCVMatInt::InstSeq Seq =
RISCVMatInt::generateInstSeq(Imm, Subtarget.getFeatureBits());
SDNode *Result = nullptr;
- SDValue SrcReg = CurDAG->getRegister(RISCV::X0, XLenVT);
+ SDValue SrcReg = CurDAG->getRegister(RISCV::X0, VT);
for (RISCVMatInt::Inst &Inst : Seq) {
- SDValue SDImm = CurDAG->getTargetConstant(Inst.Imm, DL, XLenVT);
+ SDValue SDImm = CurDAG->getTargetConstant(Inst.Imm, DL, VT);
switch (Inst.getOpndKind()) {
case RISCVMatInt::Imm:
- Result = CurDAG->getMachineNode(Inst.Opc, DL, XLenVT, SDImm);
+ Result = CurDAG->getMachineNode(Inst.Opc, DL, VT, SDImm);
break;
case RISCVMatInt::RegX0:
- Result = CurDAG->getMachineNode(Inst.Opc, DL, XLenVT, SrcReg,
- CurDAG->getRegister(RISCV::X0, XLenVT));
+ Result = CurDAG->getMachineNode(Inst.Opc, DL, VT, SrcReg,
+ CurDAG->getRegister(RISCV::X0, VT));
break;
case RISCVMatInt::RegReg:
- Result = CurDAG->getMachineNode(Inst.Opc, DL, XLenVT, SrcReg, SrcReg);
+ Result = CurDAG->getMachineNode(Inst.Opc, DL, VT, SrcReg, SrcReg);
break;
case RISCVMatInt::RegImm:
- Result = CurDAG->getMachineNode(Inst.Opc, DL, XLenVT, SrcReg, SDImm);
+ Result = CurDAG->getMachineNode(Inst.Opc, DL, VT, SrcReg, SDImm);
break;
}
More information about the llvm-commits
mailing list