From e094cc4372bfe378f2e455879e501a7f890b8eba Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Fri, 20 Jan 2017 00:30:17 +0000 Subject: [PATCH] GlobalISel: Add a note about how we're being a bit loose with memory operands The logic in r292461 is conservatively correct, but we should revisit this later. Add a TODO so we don't forget. llvm-svn: 292553 --- llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp index 0f23c2f03584..5f23d253f56f 100644 --- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp @@ -177,6 +177,8 @@ LegalizerHelper::LegalizeResult LegalizerHelper::narrowScalar(MachineInstr &MI, MIRBuilder.buildConstant(Offset, i * NarrowSize / 8); MIRBuilder.buildGEP(SrcReg, MI.getOperand(1).getReg(), Offset); + // TODO: This is conservatively correct, but we probably want to split the + // memory operands in the future. MIRBuilder.buildLoad(DstReg, SrcReg, **MI.memoperands_begin()); DstRegs.push_back(DstReg); @@ -202,6 +204,8 @@ LegalizerHelper::LegalizeResult LegalizerHelper::narrowScalar(MachineInstr &MI, unsigned Offset = MRI.createGenericVirtualRegister(LLT::scalar(64)); MIRBuilder.buildConstant(Offset, i * NarrowSize / 8); MIRBuilder.buildGEP(DstReg, MI.getOperand(1).getReg(), Offset); + // TODO: This is conservatively correct, but we probably want to split the + // memory operands in the future. MIRBuilder.buildStore(SrcRegs[i], DstReg, **MI.memoperands_begin()); } MI.eraseFromParent();