From 91e5a47341f49e5be2de6fdbdb902b0f674f1390 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292553 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/lib/CodeGen/GlobalISel/LegalizerHelper.cpp index 0f23c2f0358..5f23d253f56 100644 --- a/lib/CodeGen/GlobalISel/LegalizerHelper.cpp +++ b/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();