search for: gettargetasminfo

Displaying 8 results from an estimated 8 matches for "gettargetasminfo".

2011 Jul 06
0
[LLVMdev] MCInstPrinter::printRegName
...gister number in function InstPrinter->printRegName? I just want to have it output the same register number as before (the same output the false path would produce). void MCAsmStreamer::EmitRegisterName(int64_t Register) { if (InstPrinter) { const TargetAsmInfo &asmInfo = getContext().getTargetAsmInfo(); unsigned LLVMRegister = asmInfo.getLLVMRegNum(Register, true); InstPrinter->printRegName(OS, LLVMRegister); } else { OS << Register; } } My current implementation of printRegName which I copied from other backends (X86, ARM and PowerPC) looks like this: void MipsInstPr...
2008 Apr 16
0
[LLVMdev] Being able to know the jitted code-size before emitting
...n(MachineInstr *MI) { > - switch (MI->getOpcode()) { > - case PPC::INLINEASM: { // Inline Asm: Variable size. > - MachineFunction *MF = MI->getParent()->getParent(); > - const char *AsmStr = MI->getOperand(0).getSymbolName(); > - return MF->getTarget().getTargetAsmInfo()- > >getInlineAsmLength(AsmStr); > - } > - case PPC::LABEL: { > - return 0; > - } > - default: > - return 4; // PowerPC instructions are all 4 bytes > - } > -} > - > - > bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) { > const Ta...
2008 Apr 15
4
[LLVMdev] Being able to know the jitted code-size before emitting
OK, here's a new patch that adds the infrastructure and the implementation for X86, ARM and PPC of GetInstSize and GetFunctionSize. Both functions are virtual functions defined in TargetInstrInfo.h. For X86, I moved some commodity functions from X86CodeEmitter to X86InstrInfo. What do you think? Nicolas Evan Cheng wrote: > > I think both of these belong to TargetInstrInfo. And
2008 Apr 17
1
[LLVMdev] Being able to know the jitted code-size before emitting
Thx again Evan for the review. Here's a new patch for the JIT in itself. The major changes are: 1) A JITMemoryManager now has a flag saying "I require to know the size of what you want to emit" 2) DwarfJITEmitter is augmented with GetSize* functions 3) JITEmitter::startFunction checks if the JITMemoryManager requires to know the size. If so, it computes it and gives it through the
2008 Feb 04
0
[LLVMdev] Exception handling in JIT
...gt; + unsigned char* > StartFunction, > + unsigned char* > EndFunction) { > + const TargetMachine& TM = F.getTarget(); > + TD = TM.getTargetData(); > + needsIndirectEncoding = TM.getTargetAsmInfo()- > >getNeedsIndirectEncoding(); > + stackGrowthDirection = TM.getFrameInfo()- > >getStackGrowthDirection(); > + RI = TM.getRegisterInfo(); > + MCE = &mce; > + > + unsigned char* ExceptionTable = EmitExceptionTable(&F, > StartFunction, > +...
2008 Feb 01
2
[LLVMdev] Exception handling in JIT
Dear all, Here's a new patch with Evan's comments (thx Evan!) and some cleanups. Now the (duplicated) exception handling code is in a new file: lib/ExecutionEngine/JIT/JITDwarfEmitter. This patch should work on linux/x86 and linux/ppc (tested). Nicolas -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: jit-exceptions.patch URL:
2007 Dec 11
0
[LLVMdev] Exception handling in JIT
...); > + EmitString(Personality ? "zPLR" : "zR"); > + EmitULEB128Bytes(1); > + EmitSLEB128Bytes(stackGrowth); > + EmitInt8(RI->getDwarfRegNum(RI->getRARegister(), true)); > + > + if (Personality) { > + EmitULEB128Bytes(7); > + > + if (TM.getTargetAsmInfo()->getNeedsIndirectEncoding()) > + EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 | > + dwarf::DW_EH_PE_indirect); > + else > + EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4); > + > + if (PointerSize == 8) > + EmitInt64((...
2007 Dec 10
2
[LLVMdev] Exception handling in JIT
Hi everyone, Here's a patch that enables exception handling when jitting. I've copy/pasted _many_code from lib/Codegen/DwarfWriter.cpp, so we may need to factorize it, but the functionality is there and I'm very happy with it :) lli should now be able to execute the output from llvm-gcc when using exceptions (the UnwindInst instruction is not involved in this patch). Just add the