Displaying 20 results from an estimated 30 matches for "addresult".
2004 Sep 23
2
[LLVMdev] struct and class under VC7.1
...t just linking.
You are right...
BTW, I've just fixed that problem in my checkout and, among others
terrible hacks, here I am:
:\home\arathorn\sandbox\llvm>HowToUseJIT.exe
We just constructed this LLVM module:
implementation ; Functions:
int %add1(int %AnArg) {
EntryBlock:
%addresult = add int 1, %AnArg ; <int> [#uses=1]
ret int %addresult
}
int %foo() {
EntryBlock:
%add1 = call int %add1( int 10 ) ; <int>
[#uses=1]
ret int %add1
}
Running foo: Result: 11
D:\home\arathorn\sandbox\llvm>
Yabba! Yabba! Yabba!...
2006 Apr 13
2
[LLVMdev] standalone llvm
...d JIT compile it.
I'm trying to take assembly and create machine code I can execute.
How close am I ?
Simon.
int main() {
Module *M = NULL;
char *AsmString = "; ModuleID = 'test'\n\
\n\
implementation ; Functions:\n\
\n\
int %add1(int %AnArg) {\n\
EntryBlock:\n\
%addresult = add int 1, %AnArg ; <int> [#uses=1]\n\
ret int %addresult\n\
}\n\
";
M = ParseAssemblyString(AsmString, NULL);
ExistingModuleProvider* MP = new ExistingModuleProvider(M);
ExecutionEngine* EE = ExecutionEngine::create(MP, false);
std::cout << "We j...
2004 Sep 23
0
[LLVMdev] struct and class under VC7.1
...ixed that problem in my checkout and, among others
> terrible hacks, here I am:
>
> :\home\arathorn\sandbox\llvm>HowToUseJIT.exe
> We just constructed this LLVM module:
>
>
> implementation ; Functions:
>
> int %add1(int %AnArg) {
> EntryBlock:
> %addresult = add int 1, %AnArg ; <int> [#uses=1]
> ret int %addresult
> }
>
> int %foo() {
> EntryBlock:
> %add1 = call int %add1( int 10 ) ; <int>
> [#uses=1]
> ret int %add1
> }
>
>
> Running foo: Result:...
2009 Aug 31
0
[LLVMdev] problems with the 2.6 branch under x86_64
...n"...Reading symbols for
shared libraries .... done
(gdb) r
Starting program: /Users/lrz/src/llvm-26/Release/examples/HowToUseJIT
Reading symbols for shared libraries +++. done
We just constructed this LLVM module:
; ModuleID = 'test'
define i32 @add1(i32 %AnArg) {
EntryBlock:
%addresult = add i32 1, %AnArg ; <i32> [#uses=1]
ret i32 %addresult
}
define i32 @foo() {
EntryBlock:
%add1 = tail call i32 @add1(i32 10) ; <i32> [#uses=1]
ret i32 %add1
}
Running foo:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason:...
2004 Sep 23
0
[LLVMdev] struct and class under VC7.1
MSVC++ is picky about this. It considers classes and structs to be
different types so you have to be consistent. If you forward declared a
struct as a class within the same compilation unit, it would complain
about that too. It's not just linking.
On Thu, 23 Sep 2004 15:59:42 +0200
Paolo Invernizzi <arathorn at fastwebnet.it> wrote:
> Hi all,
>
> Finally I managed to find
2005 Jan 27
1
[LLVMdev] Question about inserting IR code
Hi,
From the file HowToUseJIT.cpp, I learned how to insert some calcuation IR code like Add/Sub/Mul etc by using
Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB);
By following this way, it works well when I insert some IR code whose operand is integer type like IntTy, however, when I tried to insert similar thing whose operands are float point, I got the following message when I run it
void llvm::BinaryOperator::init(llvm::Instruction::BinaryOp...
2006 Apr 13
0
[LLVMdev] standalone llvm
On Thu, 13 Apr 2006, Simon Burton wrote:
>
> Is it possible to get llvm to generate native machine code
> without using gcc and friends ? Do I use lli ?
LLVM only needs llvm-gcc to translate from C/C++ to LLVM IR. If you
already have code in LLVM IR form (e.g. because you're generating it on
the fly or you have your own front-end) you don't need llvm-gcc.
> I'd like to
2006 Apr 13
0
[LLVMdev] Re: standalone llvm
Simon Burton <simon at arrowtheory.com> writes:
> I'm trying to take assembly and create machine code I can execute.
> How close am I ?
Your test case is not complete. Besides, which version of llvm are you
using? What are the commands for compiling and linking your test case?
How it bombs?
Do you #include "llvm/ExecutionEngine/JIT.h" ?
--
Oscar
2010 Apr 29
2
[LLVMdev] Why the same code is much slower in JIT compared to separate executable?
...Block
%arg = sub i32 %AnArg, 1 ; <i32> [#uses=1]
%fibx1 = tail call i32 @fib(i32 %arg) ; <i32> [#uses=1]
%arg1 = sub i32 %AnArg, 2 ; <i32> [#uses=1]
%fibx2 = tail call i32 @fib(i32 %arg1) ; <i32> [#uses=1]
%addresult = add i32 %fibx1, %fibx2 ; <i32> [#uses=1]
ret i32 %addresult
}
define i32 @main(i32 %argc, i8** nocapture %argv) nounwind {
entry:
%0 = getelementptr inbounds i8** %argv, i32 1 ; <i8**> [#uses=1]
%1 = load i8** %0, align 4 ; <i8*> [#uses=1]...
2011 Mar 25
0
[LLVMdev] Calling external functions failed on PowerPC
Hi, all
I found the example code examples/HowToUseJIT.cpp also shows
the same error.
Attachment is the LLVM module created by HowToUseJIT. And here
is the error,
Running foo: %X4<def> = LDtoc <ga:@add1>, %X2
UNREACHABLE executed!
Stack dump:
0. Running pass 'PowerPC Machine Code Emitter' on function '@foo'
Aborted
Currently, I use gdb try to track down
2004 Sep 23
2
[LLVMdev] struct and class under VC7.1
Hi all,
Finally I managed to find out a strange problem under Visual C
During the link of the HowToUseJIT program, I was always missing some
symbols... and I was going crazy testing out different options...
At the end, unmangling the differences in what linker was searching and
what was present in the libraries, I found that the problem is
that we have something like this...
Value.h
struct
2011 Mar 23
4
[LLVMdev] Calling external functions failed on PowerPC
Hi, all
I have a trouble with calling external functions on PowerPC.
What I am doing is generating a LLVM IR first like this,
- x86
call void @helper_shack_flush(%struct.CPUX86State* %62) noinline, !flags !12
- ppc
call void @helper_shack_flush(%struct.CPUX86State* %62) noinline, !flags !10
After lowering above LLVM IR for x86 and ppc, it becomes:
- x86
%RAX<def> = MOV64ri
2006 Apr 14
2
[LLVMdev] Re: standalone llvm
...mbly/Parser.h"
#include "llvm/Analysis/Verifier.h"
#include <iostream>
using namespace llvm;
int main() {
Module *M = NULL;
char *AsmString = "; ModuleID = 'test'\n\
\n\
implementation ; Functions:\n\
\n\
int %add1(int %AnArg) {\n\
EntryBlock:\n\
%addresult = add int 1, %AnArg ; <int> [#uses=1]\n\
ret int %addresult\n\
}\n\
";
M = ParseAssemblyString(AsmString, NULL);
std::cout << "verifyModule: " << verifyModule( *M ) << "\n";
ExistingModuleProvider* MP = new ExistingModulePro...
2004 Nov 05
0
[LLVMdev] Re: LLVM Visual Studio Project files
...= sub int %AnArg, 1 ; <int> [#uses=1]
%fibx1 = call int %fib( int %arg ) ; <int> [#uses=1]
%arg1 = sub int %AnArg, 2 ; <int> [#uses=1]
%fibx2 = call int %fib( int %arg1 ) ; <int> [#uses=1]
%addresult = add int %fibx1, %fibx2 ; <int> [#uses=1]
ret int %addresult
}
---------
starting fibonacci(10) with JIT...
Result: 55
I assume this is correct.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: win.diffs
Type: application/octet-stream...
2006 Apr 13
4
[LLVMdev] standalone llvm
Is it possible to get llvm to generate native machine code
without using gcc and friends ? Do I use lli ?
I'd like to directly create executable code that i can
stick in memory somewhere and jump into (call).
(I'm looking to use llvm in a BSD licensed project).
Simon.
--
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph. 61 02 6249 6940
http://arrowtheory.com
2004 Nov 05
2
[LLVMdev] Re: LLVM Visual Studio Project files
Like I said, it is in my path. That's not enough. I'd be happy if
Morten chimed in with any suggestions as to how he got it to work.
On Thu, 04 Nov 2004 18:45:18 -0800
Reid Spencer <reid at x10sys.com> wrote:
> Two suggestions:
>
> 1. m4 might be located by your PATH variable.
> 2. Talk to Morten Ofstad about how he got it to work.
>
> Reid.
>
> On
2004 Aug 09
1
[LLVMdev] API on JIT, code snippets
...y, 1);
>
> // Get pointers to the integer argument of the add1 function...
> Value *ArgX = 0; // FIXME!!
>
>
> // Create the add instruction... does not insert...
> Instruction *Add = BinaryOperator::create(Instruction::Add, One, ArgX,
> "addresult");
>
> // explicitly insert it into the basic block...
> BB->getInstList().push_back(Add);
>
> // Create the return instruction and add it to the basic block
> BB->getInstList().push_back(new ReturnInst(Add));
>
> // function add1 is rea...
2004 Aug 09
5
[LLVMdev] API on JIT, code snippets
...y, 1);
>
> // Get pointers to the integer argument of the add1 function...
> Value *ArgX = 0; // FIXME!!
>
>
> // Create the add instruction... does not insert...
> Instruction *Add = BinaryOperator::create(Instruction::Add, One, ArgX,
> "addresult");
>
> // explicitly insert it into the basic block...
> BB->getInstList().push_back(Add);
>
> // Create the return instruction and add it to the basic block
> BB->getInstList().push_back(new ReturnInst(Add));
>
> // function add1 is rea...
2004 Aug 17
5
[LLVMdev] JIT API example (fibonacci)
...> > exit_bb->getInstList().push_back(CallFibX2);
> >
> > }
> >
> > // Create the add instruction... does not insert...
> > Instruction *Add =
> > BinaryOperator::create(Instruction::Add,
> > CallFibX1, CallFibX2, "addresult");
> >
> > // explicitly insert it into the basic block...
> > exit_bb->getInstList().push_back(Add);
> >
> > // Create the return instruction and add it to the basic block
> > exit_bb->getInstList().push_back(new ReturnInst(Add...
2004 Aug 17
0
[LLVMdev] JIT API example (fibonacci)
...ibF, Sub, "fib(x-2)");
> exit_bb->getInstList().push_back(CallFibX2);
>
> }
>
> // Create the add instruction... does not insert...
> Instruction *Add =
> BinaryOperator::create(Instruction::Add,
> CallFibX1, CallFibX2, "addresult");
>
> // explicitly insert it into the basic block...
> exit_bb->getInstList().push_back(Add);
>
> // Create the return instruction and add it to the basic block
> exit_bb->getInstList().push_back(new ReturnInst(Add));
>...