[llvm] e3f5332 - [RISCV][GISel] Don't setType on PtrReg in RISCVInstructionSelector::replacePtrWithInt.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 15 21:34:15 PDT 2023
Author: Craig Topper
Date: 2023-10-15T21:28:20-07:00
New Revision: e3f533201c61beb49ffcf7c565ffe07763b7a616
URL: https://github.com/llvm/llvm-project/commit/e3f533201c61beb49ffcf7c565ffe07763b7a616
DIFF: https://github.com/llvm/llvm-project/commit/e3f533201c61beb49ffcf7c565ffe07763b7a616.diff
LOG: [RISCV][GISel] Don't setType on PtrReg in RISCVInstructionSelector::replacePtrWithInt.
PtrReg is still a pointer. It's being passed to G_PTRTOINT as a pointer.
Added:
Modified:
llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp b/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
index 3a86dcbd86a0ac2..12d1d64212720ff 100644
--- a/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
+++ b/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
@@ -210,7 +210,6 @@ bool RISCVInstructionSelector::replacePtrWithInt(MachineOperand &Op,
const LLT XLenLLT = LLT::scalar(STI.getXLen());
auto PtrToInt = MIB.buildPtrToInt(XLenLLT, PtrReg);
MRI.setRegBank(PtrToInt.getReg(0), RBI.getRegBank(RISCV::GPRRegBankID));
- MRI.setType(PtrReg, XLenLLT);
Op.setReg(PtrToInt.getReg(0));
return select(*PtrToInt);
}
More information about the llvm-commits
mailing list