search for: calltmp

Displaying 16 results from an estimated 16 matches for "calltmp".

2010 Nov 15
2
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
.../tutorial/LangImpl4.html#jit there's an example that optimizes calls to functions without side effects. Specifically, ready> extern sin(x); ready> extern cos(x); ready> def foo(x) sin(x)*sin(x) + cos(x)*cos(x); Read function definition: define double @foo(double %x) { entry: %calltmp = call double @sin(double %x) %multmp = fmul double %calltmp, %calltmp %calltmp2 = call double @cos(double %x) %multmp4 = fmul double %calltmp2, %calltmp2 %addtmp = fadd double %multmp, %multmp4 ret double %addtmp } I find that when I run the code, the calls...
2010 Aug 12
2
[LLVMdev] Instruction does not dominate all uses?
...39;s wrapped in a function: define double @0() { entry: ret double 9.000000e+00 } Then I define a function (ignores its one parameter and returns 4): define double @test(double %x) { entry: ret double 4.000000e+00 } And get the dump from the llvm::Value call to it (passing 10 as the arg) %calltmp = call double @test(double 1.000000e+01) ; <double> [#uses=1] the dump from the call wrapped in a function: define double @1() { entry: ret double %calltmp } but when I try to verify the wrapping function, I get: Instruction does not dominate all uses! %calltmp = call double @test(dou...
2010 Aug 12
0
[LLVMdev] Instruction does not dominate all uses?
You need to insert v into the basic block before the return. Note that %calltmp is absent from the dump of the function. The verifier is complaining because it found this pointer to %calltmp, but it didn't find the definition anywhere above its use. Reid On Thu, Aug 12, 2010 at 1:04 PM, alecbenzer <alecbenzer at gmail.com> wrote: > > This has been driving me...
2010 Nov 15
0
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...s/tutorial/LangImpl4.html#jit there's an example that optimizes calls to functions without side effects. Specifically, ready> extern sin(x); ready> extern cos(x); ready> def foo(x) sin(x)*sin(x) + cos(x)*cos(x); Read function definition: define double @foo(double %x) { entry: %calltmp = call double @sin(double %x) %multmp = fmul double %calltmp, %calltmp %calltmp2 = call double @cos(double %x) %multmp4 = fmul double %calltmp2, %calltmp2 %addtmp = fadd double %multmp, %multmp4 ret double %addtmp } I find that when I run the code, the calls...
2010 Nov 12
4
[LLVMdev] C Backend's future
Chris Lattner <clattner at apple.com> writes: > On Nov 5, 2010, at 7:11 AM, Kirk Kelsey wrote: > >> I'm wondering what the longer term plans are for the C Backend. I >> understand it's not actively developed, even deprecated. What I'm not >> clear about is whether it's something that is viewed as non-vital and >> should just as well go away, or
2017 Feb 06
3
Kaleidoscope tutorial: comments, corrections and Windows support
...el expression: define double @2() { entry: ret double 0x3FEAED548F090CEE } Evaluated to 0.841471": Actually "sin" is not called at all, LLVM knew "sin" and just returns the already const-folded value. In my case, I do see a "%calltmp = call double @sin(double 1.000000e+00)", though, inspite of the same optimizations as in your listing... - "ready> def foo(x) sin(x)*sin(x) + cos(x)*cos(x); Read function definition: define double @foo(double %x) { entry: %calltmp = call double @sin(double...
2008 Sep 25
3
[LLVMdev] Kaleidoscope doesn't work properly
...#39;ve copied the toy source code exactly and didn't change it. Here is the log: # ./toy ready> extern putchard(x); ready> Read extern: declare double @putchard(double) ready> def asd (a) putchard(a); ready> Read function definition: define double @asd(double %a) { entry: %calltmp = call double @putchard( double %a ) ; <double> [#uses=1] ret double %calltmp } ready> asd(120); ready> ERROR: Program used external function 'putchard' which could not be resolved! Abort (core dumped) Here is the backtrace from the toy.core: (gdb) backtrace...
2014 May 04
3
[LLVMdev] function pointer from name?
Don't you have the same problem with other atoms, e.g. variable names? This sounds like something that should be implemented in the language's runtime library. On May 4, 2014 7:15 PM, "Alexander Popolitov" <popolit at gmail.com> wrote: > Hi everyone! > > I'm trying to implement lisp's funcall function, which roughly calls a > function, name of which
2008 Sep 25
0
[LLVMdev] Kaleidoscope doesn't work properly
...hange it. > > Here is the log: > # ./toy > ready> extern putchard(x); > ready> Read extern: > declare double @putchard(double) > > ready> def asd (a) putchard(a); > ready> Read function definition: > define double @asd(double %a) { > entry: > %calltmp = call double @putchard( double %a ) ; > <double> [#uses=1] > ret double %calltmp > } > > ready> asd(120); > ready> ERROR: Program used external function 'putchard' which could > not be resolved! > Abort (core dumped) > > Here is t...
2010 Nov 15
2
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...on::addFnAttr(Attribute) for example. Hmm ... I tried setting that right after Function::Create but I still get the same result (though flagged with "readonly") declare double @sin(double) readonly declare double @cos(double) readonly define double @foo(double %x) readonly { entry: %calltmp = call double @sin(double %x) %calltmp1 = call double @sin(double %x) %multmp = fmul double %calltmp, %calltmp1 %calltmp2 = call double @cos(double %x) %calltmp3 = call double @cos(double %x) %multmp4 = fmul double %calltmp2, %calltmp3 %addtmp = fadd double %multmp, %multmp4 ret doubl...
2012 Mar 02
0
[LLVMdev] General modular and multiprecision arithmetic
...() declare i1024 @modadd1024(i1024, i1024, i1024) declare i1024 @modsub1024(i1024, i1024, i1024) declare i1024 @modmul1024(i1024, i1024, i1024) declare i1024 @modexp1024(i1024, i1024, i1024) declare i1 @Verify(i1) define void @Round0() { entry: ret void } define i1024 @Round1() { entry: %calltmp = call i1024 @Random() store i1024 %calltmp, i1024* @_r_1 %_r_1 = load i1024* @_r_1 %_t_1 = call i1024 @modexp1024(i1024 3, i1024 %_r_1, i1024 17) ret i1024 %_t_1 } I want this IR to be transformable to multiple architectures (x86, ARM, even 8051 so C++ target code generation is a no-no) w...
2016 Sep 19
3
llvm interpreter does not find function defined by addGlobalMapping
..."evaluation"); llvm::IRBuilder<> builder(context); builder.SetInsertPoint(pBlock); // code for call of the c function. auto pFunction2 = pModule->getFunction("testFunction"); auto temp = builder.CreateCall(pFunction2, std::vector<llvm::Value*>(), "calltmp"); builder.CreateRet(temp); // generation of the llvm function calling the c function llvm::FunctionType* ftWrapper = llvm::FunctionType::get(llvm::Type::getDoubleTy(context),noArgTypes, false); auto pWrapperFunction = llvm::Function::Create(ftWrapper, llvm::Function::ExternalLinkage,...
2017 May 29
2
Print 128 bit value at runtime using printf
...ring is declared as a "global constant" at the top of the module. Value* val=Builder.CreateGlobalStringPtr(formatString,"str"); std::vector<Value*>::iterator it = argsValueVector.begin(); argsValueVector.insert(it,val); } return Builder.CreateCall(F,argsValueVector,"calltmp") ; } -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170529/bd4cff36/attachment.html>
2010 Feb 17
2
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...n ErrorV("Incorrect # arguments passed"); std::vector<Value*> ArgsV; for (unsigned i = 0, e = Args.size(); i != e; ++i) { ArgsV.push_back(Args[i]->Codegen()); if (ArgsV.back() == 0) return 0; } return Builder.CreateCall(CalleeF, ArgsV.begin(), ArgsV.end(), "calltmp"); } Function *PrototypeAST::Codegen() { // Make the function type: double(double,double) etc. std::vector<const Type*> Doubles(Args.size(), Type::getDoubleTy(getGlobalContext())); FunctionType *FT = FunctionType::get(Type::getDoubleTy(getGlobalContext()), Doubles, false); Fun...
2010 Feb 17
0
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...ents passed"); > > std::vector<Value*> ArgsV; > for (unsigned i = 0, e = Args.size(); i != e; ++i) { > ArgsV.push_back(Args[i]->Codegen()); > if (ArgsV.back() == 0) return 0; > } > > return Builder.CreateCall(CalleeF, ArgsV.begin(), ArgsV.end(), "calltmp"); > } > > Function *PrototypeAST::Codegen() { > // Make the function type: double(double,double) etc. > std::vector<const Type*> Doubles(Args.size(), > Type::getDoubleTy(getGlobalContext())); > FunctionType *FT = > FunctionType::get(Type::getDoubleTy(getGloba...
2010 Feb 17
1
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...d::vector<Value*> ArgsV; >>  for (unsigned i = 0, e = Args.size(); i != e; ++i) { >>    ArgsV.push_back(Args[i]->Codegen()); >>    if (ArgsV.back() == 0) return 0; >>  } >> >>  return Builder.CreateCall(CalleeF, ArgsV.begin(), ArgsV.end(), >> "calltmp"); >> } >> >> Function *PrototypeAST::Codegen() { >>  // Make the function type:  double(double,double) etc. >>  std::vector<const Type*> Doubles(Args.size(), >> Type::getDoubleTy(getGlobalContext())); >>  FunctionType *FT = >> FunctionType...