Displaying 20 results from an estimated 300 matches similar to: "[LLVMdev] MachineBasicBlock insertion"
2010 Oct 20
1
[LLVMdev] MachineBasicBlock insertion and use/def list update
Hi all,
I am still stumped on the same bug. Did anyone try to insert
MachineBasicBlock into a MachineFunction?
Any advice will be appreciated. Thanks a lot in advance.
~Bin
----------------------------------------------------------------------------------------------------------------------------
Thanks a lot Jeff. I changed the setNumber function call to
2017 Jun 05
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
Since the getelementptrs were implicitly generated by the CreateStore/Load
I'm not sure how to get access to them.
So I hacked the assignment to be done thrice: once using a manual
decomposition into two GEPs and stores, once using the "big" CreateStore,
once via the setGlobal function, printing addresses and memory contents at
each point to the degree that I have access to them.
2017 Jun 06
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
On Mon, Jun 5, 2017 at 1:34 PM, Nikodemus Siivola <
nikodemus at random-state.net> wrote:
> Uh. Turns out that if I hide the pointer to @foo from LLVM by passing it
> through an opaque identity function ... then everything works fine.
>
> Is this a bug in LLVM or is there some magic involving globals I'm
> misunderstanding?
>
This looks like a bug in the handling of
2017 Jun 06
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
That's useful to know that the static compilation code path works.
Furthermore, as expected from that:
52: c7 05 04 00 00 00 d5 00 00 00 movl $213, 4
00000054: IMAGE_REL_I386_DIR32 _foo
It looks like the offset `4` of the second field of your struct is correct
in the object file, so this does seem to be a problem in the JIT-specific
linking/loading.
2017 Jun 07
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
My code was hinky, but only in the sense that I was accidentally
duplicating the definition variable in the module where the function was.
With only the declaration in the second module loading the bitcode
reproduces the issue.
Managed an lli reproduction:
$ cat jit-0.ll
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple =
2009 Jul 08
2
[LLVMdev] Selection of multiple instructions
Hi,
I'm currently trying to modify LLVM to include runtime checks into X86
binaries. I've looked into some of the possibilities during the phases
happening in LLVM and have the impression that inserting runtime checks
during selection would be great, since lots of optimizations are already
done and I can work directly with X86 instructions.
I've read through the documentation for
2006 Dec 20
1
[LLVMdev] Instruction sets requiring more than 3 operands
Dear Mr. Cheng:
Thank you for kind information.
Can you tell me in more detail about that?
For example, I am trying to implement 'demultiplex' instruction as follows:
demultiplex <multiplexid,choose,branch0id,branch1id,…,otherwisebranchid>
In this case, the number of branch#id is not definite. It can be 1, 2, 3...or any number.
My question was about this. I am still not sure how
2009 Sep 06
0
[LLVMdev] How to differentiate between external and internal calls in llc?
I have a MachineFunctionPass plugged into llc during
LLVMTargetMachine::addPreRegAlloc. In this Pass I need to extend calls (i.
e. CALL32m, CALL32r) iff they call function within the program.
CALL32m has, I think, ten different possibilities for the four operands
giving the target address. At the moment I have excluded calls that give the
displacement as GlobalAddress or JumpTableIndex
2013 Sep 26
2
[LLVMdev] Register scavenger and SP/FP adjustments
Consider this example:
--- ex.ll ---
declare void @bar()
; Function Attrs: nounwind optsize
define void @main() {
entry:
%hin = alloca [256 x i32], align 4
%xin = alloca [256 x i32], align 4
call void @bar()
ret void
}
-------------
Freshly built llc:
llc -O2 -march=x86 < ex.ll -print-before-all
# *** IR Dump Before Prologue/Epilogue Insertion & Frame Finalization ***:
#
2013 Sep 26
0
[LLVMdev] Register scavenger and SP/FP adjustments
The code has changed a lot over the years. Looks like at some point of time the assumption was broken. calculateCallsInformation() may have eliminated the pseudo set up instructions already.
// If call frames are not being included as part of the stack frame, and
2017 Jun 04
2
[newbie] trouble with global variables and CreateLoad/Store in JIT
Emitting calls to these functions (written in an .ll file linked in) works
fine, and does the right thing.
%Any = type { i8*, i32 }
define dllexport void @setGlobal(%Any* %ptr, %Any %value) {
store %Any %value, %Any* %ptr
ret void
}
define dllexport %Any @getGlobal(%Any* %ptr) {
%val = load %Any, %Any* %ptr
ret %Any %val
}
Trying to replace the setGlobal call with what should be
2013 Sep 26
1
[LLVMdev] Register scavenger and SP/FP adjustments
Thanks, I'll look into that. Still, the case where the function does
not call anything remains---in such a situation there are no
ADJCALLSTACK pseudos, so regardless of what that function you pointed at
does, there won't be any target-independent information about the SP
adjustment by the time the frame index elimination runs.
Would it make sense to have ADJCALLSTACK pseudos every
2006 Jun 26
2
[LLVMdev] Mapping bytecode to X86
Dear guys,
I am in need of more of your help. I'm implementing a register
allocator, and I am having problems to make it produce correct code.
Consider this program here:
int main(int argc, char ** argv) {
int i, j, sum;
i = argv[0][0];
j = argv[0][1];
sum = (i + j) * j;
printf("Sum = %d\n", sum);
}
that maps to this llvm bytecode:
entry (0xa785590, LLVM
2007 Dec 20
1
[LLVMdev] Code Generation Problem llvm 1.9
I sent a long message yesterday describing a problem I thought had to do with the JIT stubs.
After further investigating, the problem seems to be in the code generation.
The following basic block seems to have an error in it's code generation:
__exp.exit: ; preds = %codeRepl258, %__exp_bb_bb.exit
phi double [ 1.000000e+00, %codeRepl258 ], [ %.reload.reload.i,
2007 Dec 19
0
[LLVMdev] JIT Stub Problem
I'm having an issue with the Stubs used by the JIT Compiler. I'm not sure if it's a bug or if I'm doing something incorrectly.
I've got a long complicated function with the following basic blocks at the end of it (The complete .ll file is attached):
falseBlock: ; preds = %__exp.exit340
ret int 617
codeRepl: ; preds = %__exp.exit340
2016 Mar 24
0
Problem with inserting a function call after certain x86 instructions
Hi all,
I am writing a pass subclassing the MachineFunctionPass and doing the
instrumentation in runOnMachineFunction(). But I do not know how to insert
a function call. In my work, I write a special function for a program to be
compiled and I need to insert this function after certain instructions
whose destination register is esp. In X86InstrInfo.cpp, there are two kinds
of call may be
2014 Oct 27
4
[LLVMdev] Problem in X86 backend
Hi,
I'm having some trouble wirting an instruction in the X86 backend.
I made a new intrinsic and I wrote a custom inserter for my intrinsic in the X86 backend.
Everything works fine, except for one instruction that I can't find how to write.
I want to add this instruction in one of my machine basic block: mov [rdi], 0
How can I achieve that with the LLVM api? I tried several
2012 Dec 05
2
[LLVMdev] questions about the mc-relax-all flag
Hello,
In llc, we have this flag (output of command --help | grep relax):
-mc-relax-all - When used with filetype=obj, relax all fixups in
the emitted object file
It also appears in clang:
-mrelax-all (integrated-as) Relax all machine instructions
I'd like to discuss the naming and semantics of this flag, because
ISTM at least the name is misleading.
If I understand
2009 Jul 08
0
[LLVMdev] Selection of multiple instructions
On Jul 8, 2009, at 10:16 AM, Artjom Kochtchi wrote:
>
> Hi,
>
> I'm currently trying to modify LLVM to include runtime checks into X86
> binaries. I've looked into some of the possibilities during the phases
> happening in LLVM and have the impression that inserting runtime
> checks
> during selection would be great, since lots of optimizations are
> already
2013 Feb 08
2
[LLVMdev] help with X86 DAG->DAG Instruction Selection
I have an llvm ir, which generates the following machine code using llc
(llvm 3.0 on win32) after # *** IR Dump After X86 DAG->DAG Instruction
Selection ***:
The first three lines and the last two lines alone together are used to
compute "sin" for some double number.
- line 1: move the stack pointer down 8
- line 2: copy the updated stack pointer to a base register
- line 3: copy a