[llvm-commits] [llvm] r129571 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/AsmPrinter/DwarfCFIException.cpp lib/Target/TargetLoweringObjectFile.cpp lib/Target/X86/X86FrameLowering.cpp lib/T

Rafael Avila de Espindola rafael.espindola at gmail.com
Fri Apr 15 14:04:18 PDT 2011


On 11-04-15 12:14 PM, Anton Korobeynikov wrote:
> Hi Rafael,
>
>> +  const MachineLocation&Dst = Move->getDestination();
>> +  const MachineLocation&Src = Move->getSource();
>> +  const TargetAsmInfo&AsmInfo = OutContext.getTargetAsmInfo();
>> +  if (Dst.isReg()&&  Dst.getReg() == MachineLocation::VirtualFP) {
>> +    if (Src.getReg() == MachineLocation::VirtualFP)
>> +      OutStreamer.EmitCFIDefCfaOffset(-Src.getOffset());
>> +    else {
>> +      unsigned Reg = AsmInfo.getDwarfRegNum(Src.getReg(), true);
>> +      OutStreamer.EmitCFIDefCfa(Reg, -Src.getOffset());
>> +    }
>> +  } else if (Src.isReg()&&  Src.getReg() == MachineLocation::VirtualFP) {
>> +    unsigned Reg = AsmInfo.getDwarfRegNum(Dst.getReg(), true);
>> +    OutStreamer.EmitCFIDefCfaRegister(Reg);
>> +  } else {
>> +    unsigned Reg = AsmInfo.getDwarfRegNum(Src.getReg(), true);
>> +    OutStreamer.EmitCFIOffset(Reg, -Dst.getOffset());
>> +  }
> This code is part of AsmPrinter::EmitCFIFrameMoves(). Please use it.

Done. Thanks!

>> -    // Indicate locations of general callee saved registers in frame.
>> -    std::vector<MachineMove>  Moves;
>> -    TFL->getInitialFrameState(Moves);
>> -    Asm->EmitCFIFrameMoves(Moves);
>> -    Asm->EmitCFIFrameMoves(MMI->getFrameMoves());
> Why? Even more, it seems like you're not emitting common frame moves at all!

MC/Gas produces those when they see .cfi_startproc

>> Removed: llvm/trunk/test/CodeGen/X86/2008-12-12-PrivateEHSymbol.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-12-12-PrivateEHSymbol.ll?rev=129570&view=auto
>> ==============================================================================
>> --- llvm/trunk/test/CodeGen/X86/2008-12-12-PrivateEHSymbol.ll (original)
>> +++ llvm/trunk/test/CodeGen/X86/2008-12-12-PrivateEHSymbol.ll (removed)
>> @@ -1,12 +0,0 @@
>> -; RUN: llc<  %s -march=x86-64 -mtriple=x86_64-unknown-linux-gnu | grep ^.L_Z1fv.eh
>> -; RUN: llc<  %s -march=x86    -mtriple=i686-unknown-linux-gnu | grep ^.L_Z1fv.eh
>> -; RUN: llc<  %s -march=x86-64 -mtriple=x86_64-apple-darwin9 | grep ^__Z1fv.eh
>> -; RUN: llc<  %s -march=x86    -mtriple=i386-apple-darwin9 | grep ^__Z1fv.eh
> I don't think you're wanting to do this. At least darwin part.
>

I am trying to switch Darwin too, but yes I will add it back for now.

Cheers,
Rafael



More information about the llvm-commits mailing list