Displaying 11 results from an estimated 11 matches for "eval_expr".
2013 Jul 13
1
[LLVMdev] Inlined call properly optimized, but not function itself
I saw something strange in the optimized LLVM code. It appears that
sometimes an inlined function is optimized though the function itself is
not optimized to the same level.
Below is an example of an unoptimized/non-inlined function call:
define void @_entry() uwtable {
entry:
%0 = call i64 @eval_expr()
call void @trace_integer(i64 %0)
ret void
}
'eval_expr' is a big ugly series of branches, so I'm very happy that
LLVM figures it out and manages to optimize away the call entirely:
define void @_entry() uwtable {
entry:
tail call void @trace_integer(i64 3)
ret void
}
Obviou...
2012 Nov 02
4
[LLVMdev] Instruction does not dominate all uses! <badref> ??
...rouble figuring out what the error "Instruction does not
dominate all uses!" means. I'm trying to construct a call to a function
with two parameters. The printed IR, with error, looks like this:
define i32 @add(i32, i32) {
EntryBlock:
%2 = add i32 %0, %1
ret i32 %2
}
define i32 @eval_expr() {
EntryBlock:
ret i32 <badref>
}
Instruction does not dominate all uses!
<badref> = call i32 @add(i32 2, i32 3)
ret i32 <badref>
And the approximate/simplified code I'm using to generate the call,
which would appear at <badref> is:
llvm::Value * func = modul...
2012 Nov 02
0
[LLVMdev] Instruction does not dominate all uses! <badref> ??
...on does not
> dominate all uses!" means. I'm trying to construct a call to a function
> with two parameters. The printed IR, with error, looks like this:
>
> define i32 @add(i32, i32) {
> EntryBlock:
> %2 = add i32 %0, %1
> ret i32 %2
> }
>
> define i32 @eval_expr() {
> EntryBlock:
> ret i32<badref>
> }
>
> Instruction does not dominate all uses!
> <badref> = call i32 @add(i32 2, i32 3)
> ret i32<badref>
It's correct but not entirely helpful. You've got an instruction in
function @eval_expr whose ope...
2012 Dec 30
2
[LLVMdev] alignment issue, getting corrupt double values
...pe %outer then proceed to
extract the components of the contained %inner structure I get corrupt
values. If I don't have the "i1" type in there everything works fine,
leading me to think it is something to do with alignment. I do the
extraction with code like this:
%o = call %outer @eval_expr()
%s = extractvalue %outer %o, 1
%s1 = extractvalue %inner %s, 0
The %s1 value is not correct (not what was inserted). I think extraction
is the problem and not insertion: in another version I store the value
to a global variable and dump the bytes of the structure, which can then
be properly ex...
2012 Nov 04
0
[LLVMdev] trying to understand linkage with linker
If I create a function in a module with:
auto f = module->getOrInsertFunction( "eval_expr", ...)
//create function
Then later I link this with other modules:
Linker link;
link.LinkInModule( base_module );
link.LinkInModule( module );
Then I create an execution engine something like:
auto ee = EngineBuilder( link.getModule() )...create();
If I attempt to run the function dir...
2012 Nov 02
0
[LLVMdev] Instruction does not dominate all uses! <badref> ??
...on does not
> dominate all uses!" means. I'm trying to construct a call to a function
> with two parameters. The printed IR, with error, looks like this:
>
> define i32 @add(i32, i32) {
> EntryBlock:
> %2 = add i32 %0, %1
> ret i32 %2
> }
>
> define i32 @eval_expr() {
> EntryBlock:
> ret i32 <badref>
> }
>
> Instruction does not dominate all uses!
> <badref> = call i32 @add(i32 2, i32 3)
> ret i32 <badref>
Looks like you forgot to add the call instruction to EntryBlock.
>
>
> And the approximate/simp...
2012 Nov 11
1
[LLVMdev] wrong value with getPointerToGlobal
I'm having some trouble getting access to a global variable with
getPointerToGlobal. The resulting value is not what I am expecting.
My assembly looks something like this:
@gresult = global i32 undef
define i32 @eval_expr() {
entry:
...
store i32 %3, i32* @gresult
ret i32 %3
}
Where "gresult" is created with:
auto global = new llvm::GlobalVariable( *module, int32Type,
/*constant*/false, llvm::GlobalValue::ExternalLinkage, /*init*/0,
"gresult" );
I run the function and get the results wi...
2012 Nov 02
2
[LLVMdev] Instruction does not dominate all uses! <badref> ??
...quot; means. I'm trying to construct a call to a function
>> with two parameters. The printed IR, with error, looks like this:
>>
>> define i32 @add(i32, i32) {
>> EntryBlock:
>> %2 = add i32 %0, %1
>> ret i32 %2
>> }
>>
>> define i32 @eval_expr() {
>> EntryBlock:
>> ret i32<badref>
>> }
>>
>> Instruction does not dominate all uses!
>> <badref> = call i32 @add(i32 2, i32 3)
>> ret i32<badref>
>
> It's correct but not entirely helpful. You've got an instruc...
2012 Dec 30
0
[LLVMdev] alignment issue, getting corrupt double values
...ct the components of the contained %inner structure I get corrupt
> values. If I don't have the "i1" type in there everything works fine,
> leading me to think it is something to do with alignment. I do the
> extraction with code like this:
>
> %o = call %outer @eval_expr()
> %s = extractvalue %outer %o, 1
> %s1 = extractvalue %inner %s, 0
>
> The %s1 value is not correct (not what was inserted). I think extraction
> is the problem and not insertion: in another version I store the value
> to a global variable and dump the bytes of t...
2012 Nov 03
1
[LLVMdev] import/export functions between Modules
I'm having trouble figuring out how to export/import IR functions at the
C++ API level. I think I've got the linking part figured out, but I need
to get the functions exporting from one module into another. I see how I
can iterate over the functions in one, but I'm not clear on how to
expose this name/reference into the other module.
Is there a simple example/tutorial of this
2012 Dec 30
2
[LLVMdev] alignment issue, getting corrupt double values
...of the contained %inner structure I get corrupt
> values. If I don't have the "i1" type in there everything works fine,
> leading me to think it is something to do with alignment. I do the
> extraction with code like this:
>
> %o = call %outer @eval_expr()
> %s = extractvalue %outer %o, 1
> %s1 = extractvalue %inner %s, 0
>
> The %s1 value is not correct (not what was inserted). I think extraction
> is the problem and not insertion: in another version I store the value
> to a global variable an...