Displaying 20 results from an estimated 5000 matches similar to: "[LLVMdev] build a machine instruction by itself"
2013 Feb 15
2
[LLVMdev] build a machine instruction by itself
On 02/15/2013 03:07 PM, Jakob Stoklund Olesen wrote:
> On Feb 15, 2013, at 1:21 PM, Reed Kotler <rkotler at mips.com> wrote:
>
>> I want to have some functions that create machine instructions, not specifying which machine function or basic block or iterator they are part of.
> All machine instructions must be created by a machine function. It provides the context for memory
2013 Feb 15
0
[LLVMdev] build a machine instruction by itself
On Feb 15, 2013, at 1:21 PM, Reed Kotler <rkotler at mips.com> wrote:
> I want to have some functions that create machine instructions, not specifying which machine function or basic block or iterator they are part of.
All machine instructions must be created by a machine function. It provides the context for memory allocation etc.
> And then I want to use that result when adding
2013 Feb 16
0
[LLVMdev] build a machine instruction by itself
I ended up settling on a scheme which I'm not completely happy with but
it's the best I can see to do.
const MCInstrDesc& AddiuSpImm(int64_t Imm) const;
and then
if (isInt<16>(-Remainder))
BuildMI(MBB, I, DL, AddiuSpImm(-Remainder)).addImm(-Remainder);
So the AddiuSpImm choses which instruction description to use depending
on the immediate value and then
2010 Aug 27
3
[LLVMdev] What does this error mean: psuedo instructions should be removed before code emission?
On Aug 27, 2010, at 11:00 AMPDT, Eric Christopher wrote:
>>>
>>> For some reason I am getting this error even when I only have an
>>> empty 'main' function. So I couldn't create .ll file reproducing
>>> it and I have to debug myself.
>>>
>>> The function causing the problem is stub created in
>>> JIT::runFunction:
2010 Aug 27
2
[LLVMdev] What does this error mean: psuedo instructions should be removed before code emission?
On 08/27/2010 11:32, Yuri wrote:
> As I understand only one of TCRETURNri64 and RET should be created.
> I have sources of rev.112200.
>
> Here is the stack when TCRETURNri64 instruction is created:
> #1 0x0000000802c8b4e2 in llvm::MachineFunction::CreateMachineInstr
> (this=0x30eb000, TID=@0x803a78940, DL={LineCol = 0, ScopeIdx = 0},
> NoImp=false) at
2010 Aug 27
0
[LLVMdev] What does this error mean: psuedo instructions should be removed before code emission?
On 08/27/2010 11:05, Dale Johannesen wrote:
>>>> Function only has on BB. Is this wrong that it has both
>>>> TCRETURNri64 and RET in one BB?
>>>
>>> Yes, that is wrong. The reason emitEpilogue isn't lowering the
>>> TCRETURN is that it doesn't see it, it only sees the RET. The real
>>> problem will be where that RET is
2010 Aug 27
0
[LLVMdev] What does this error mean: psuedo instructions should be removed before code emission?
On Aug 27, 2010, at 11:53 AMPDT, Yuri wrote:
> On 08/27/2010 11:32, Yuri wrote:
>> As I understand only one of TCRETURNri64 and RET should be created.
>> I have sources of rev.112200.
>>
>> Here is the stack when TCRETURNri64 instruction is created:
>> #1 0x0000000802c8b4e2 in llvm::MachineFunction::CreateMachineInstr
>> (this=0x30eb000, TID=@0x803a78940,
2009 Jun 04
1
[LLVMdev] assertion in LeakDetector
Hi Bill,
I am using the following version of BuildMI :
MachineInstrBuilder BuildMI(MachineFunction &MF,
const TargetInstrDesc &TID,
unsigned DestReg)
I do the following :
void createInstrs(std::vector<MachineInstr *>& ilist)
{
Machine Instr *mi;
mi = BuildMI(MF, someTID, somereg);
2016 Apr 15
3
[Sparc] Load address with SETHI
Hi,
I'm trying to implement __builtin_setjmp / __builtin_longjmp for Sparc processors. I think I'm very close, but I can't work out how to issue BuildMI-type instructions to load the address of the recovery location (set in setjmp) into a register using the SETHI / OR combination. I can't see any equivalent code anywhere else in Sparc.
I imagine this is similar if I try to make a
2015 Sep 08
4
Inserting MachineInstr's
Hi,
I have a task to complete and I'm getting stuck. I can't find anything comparable in the documentation. The shortest explanation I can give is as follows: I need to use double-precision floating point values for floating-point multiplies. I'll not go into why: That would take the discussion away from the essential problem. E.g.
Replace:
fmuls %f20,%f21,%f8
with the
2014 Dec 08
2
[LLVMdev] Virtual register problem in X86 backend
Hi,
I'm having trouble using virtual register in the X86 backend.
I implemented a new intrinsic and I use a custom inserter. The goal of
the intrinsic is to set the content of the stack to zero at the end of
each function.
Here is my code:
MachineBasicBlock *
X86TargetLowering::EmitBURNSTACKWithCustomInserter(
MachineInstr *MI,
MachineBasicBlock
2013 Feb 18
1
[LLVMdev] splitting a branch within a pseudo
Some stuff did not get pasted in properly.
static MachineBasicBlock* ExpandCondMov(MachineInstr *MI,
MachineBasicBlock *BB,
DebugLoc dl,
const MipsSubtarget *Subtarget,
const TargetInstrInfo *TII,
bool isFPCmp, unsigned Opc) {
//
2013 Feb 18
0
[LLVMdev] splitting a branch within a pseudo
This is the old MIPS I code that sort of does what I need to do. This
seems really involved to do such a simple thing.
Maybe there are now helper classes for this or some better example I can
look at. I suppose I can mimick this if people say this just the correct
way to do this in LLVM.
static MachineBasicBlock* ExpandCondMov(MachineInstr *MI,
MachineBasicBlock *BB,
2014 Oct 28
2
[LLVMdev] Problem in X86 backend (again)
Hi,
I'm still having problems implementing my custom inserter in the X86 backend.
I found a solution to my last problem (http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-October/078296.html), by using a virtual register.
The binary works when it's compiled in -O0, but not in -O1,-O2,...
I really can't figure what I'm doing wrong... Any idea?
Here is the code of my custom
2013 Feb 17
4
[LLVMdev] splitting a branch within a pseudo
After discussions last night, I'm leaning towards going legit with all
my pseudo expansions in Mips 16.
Some I think I can clearly do by just putting in the proper side effects
of implicit registers (T8 the condition code register as used by mips 16).
But I'm still left with some pseudos that have jmp .+4 type instructions
in them.
The original Mips port was to Mips I and Mips I,
2020 Nov 12
2
LLVM X86 MachineBasicBlock inserting push and pop instructions causes segmentation fault
Hello,
I am working on a project where I need to insert some logic before each
machine basic block.
In particular, it involves setting some global variables and calling a
function. I'm able to add the instructions and verify they get added, but
when the compiled program runs, it stops with a segfault.
For brevity, I'm not sharing the whole code here but basically I have a X86
2018 Sep 10
3
How to avoid multiple registers definitions in customInserter.
Hi,
I'm lowering some of the logical operators (by example the | operator) on integer32.
Sadly my target only provide native instruction on high and low parts of 32 bits registers.
So, I have to generate a sequence of two native instructions (LOR followed by HOR).
I've introduced an Pseudo instruction with a custom inserter.
def OR_A_oo : CLPPseudoInst<(ins
2015 Nov 22
2
BuildMI crashes on a certain probability on the exact same test
Dear there,
I'm trying to call BuildMI in my backend to add a machineinstr.
BuildMI(MBB, I, I->getDebugLoc(), TII->get(Vanilla::MOV),
Vanilla::R1).addReg(MI->getOperand(1).getReg());
But it gives me an error like this:
0 clang 0x000000010e61a56e
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 46
1 clang 0x000000010e61c209
2010 Oct 20
1
[LLVMdev] MachineBasicBlock insertion
Hi all,
I am really stumped on a problem for long. I could not figure out why.
That is why i am here. OK, here is the problem:
I tried to insert a MachineBasicBlock into a function. Here is the code
snippet:
// insert a machine basic block with the error_label into MF and before I
// Pred is the predecessor of the block to be inserted
// the new basic block is inserted right before I
void
2009 Jun 04
2
[LLVMdev] assertion in LeakDetector
I am seeing the following assertion in leak detector.
/llvm/lib/VMCore/LeakDetector.cpp:43:
void<unnamed>::LeakDetectorImpl<T>::addGarbage(const T*) [with T =
void]: Assertion `Ts.count(Cache) == 0 && "Object already in set!"'
failed.
I am creating a list of instructions using BuildMI() and adding them
to a basic block using BB->insert(). I am seeing this