]> granicus.if.org Git - llvm/commitdiff
GlobalISel: Add a note about how we're being a bit loose with memory operands
authorJustin Bogner <mail@justinbogner.com>
Fri, 20 Jan 2017 00:30:17 +0000 (00:30 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 20 Jan 2017 00:30:17 +0000 (00:30 +0000)
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

index 0f23c2f03584eec12613a8e44f681ecd8f2a88ce..5f23d253f56ff89cdac7b9f1a264f2f3fa1864f6 100644 (file)
@@ -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();