[llvm] r207736 - ARM: support expanding external symbols in 32-bit moves

Saleem Abdulrasool compnerd at compnerd.org
Thu May 1 07:53:30 PDT 2014


On Thursday, May 1, 2014, Rafael EspĂ­ndola <rafael.espindola at gmail.com>
wrote:

> testcase?


I'm not certain how to exercise this from LLIR or assembly.  References
there would be global addresses.  This would require a handcrafted MI.  We
generate such an instruction in the stack probe emission for Windows on ARM
and the existing test for that does exercise this.

Perhaps I should have merged this with the leak cleanup itself to make it
clearer.


> On 1 May 2014 00:19, Saleem Abdulrasool <compnerd at compnerd.org<javascript:;>>
> wrote:
> > Author: compnerd
> > Date: Wed Apr 30 23:19:56 2014
> > New Revision: 207736
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=207736&view=rev
> > Log:
> > ARM: support expanding external symbols in 32-bit moves
> >
> > This enhances the expansion of the mov32imm pseudo-instruction to
> support an
> > external symbol reference.  This is motivated by a simplification of the
> stack
> > probe emission for Windows on ARM (and fixing a leak).
> >
> > Modified:
> >     llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp
> >
> > Modified: llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp?rev=207736&r1=207735&r2=207736&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp (original)
> > +++ llvm/trunk/lib/Target/ARM/ARMExpandPseudoInsts.cpp Wed Apr 30
> 23:19:56 2014
> > @@ -705,17 +705,29 @@ void ARMExpandPseudo::ExpandMOV32BitImm(
> >      .addReg(DstReg, RegState::Define | getDeadRegState(DstIsDead))
> >      .addReg(DstReg);
> >
> > -  if (MO.isImm()) {
> > +  switch (MO.getType()) {
> > +  case MachineOperand::MO_Immediate: {
> >      unsigned Imm = MO.getImm();
> >      unsigned Lo16 = Imm & 0xffff;
> >      unsigned Hi16 = (Imm >> 16) & 0xffff;
> >      LO16 = LO16.addImm(Lo16);
> >      HI16 = HI16.addImm(Hi16);
> > -  } else {
> > +    break;
> > +  }
> > +  case MachineOperand::MO_ExternalSymbol: {
> > +    const char *ES = MO.getSymbolName();
> > +    unsigned TF = MO.getTargetFlags();
> > +    LO16 = LO16.addExternalSymbol(ES, TF | ARMII::MO_LO16);
> > +    HI16 = HI16.addExternalSymbol(ES, TF | ARMII::MO_HI16);
> > +    break;
> > +  }
> > +  default: {
> >      const GlobalValue *GV = MO.getGlobal();
> >      unsigned TF = MO.getTargetFlags();
> >      LO16 = LO16.addGlobalAddress(GV, MO.getOffset(), TF |
> ARMII::MO_LO16);
> >      HI16 = HI16.addGlobalAddress(GV, MO.getOffset(), TF |
> ARMII::MO_HI16);
> > +    break;
> > +  }
> >    }
> >
> >    LO16->setMemRefs(MI.memoperands_begin(), MI.memoperands_end());
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu <javascript:;>
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>


-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140501/8223b915/attachment.html>


More information about the llvm-commits mailing list