similar to: [LLVMdev] LLVM target-independent code generator for reconfigurable logic

Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] LLVM target-independent code generator for reconfigurable logic"

2009 Jun 18
2
[LLVMdev] Referring to an argument in another function
I would like to instrument certain function calls with a function call of my own that takes some of the same arguments. For example, I would like to instrument calls to free with some function foo, so the C code would look like: foo(myarg1, myarg2, ptr); free(ptr); The problem occurs when I grab the arg from the free function and try to pass it to foo... if (isCallToFree(&I)) { Value*
2011 Sep 16
2
[LLVMdev] How to duplicate a function?
Hi all, Sorry for the inconvenient about the previous post. The files were not attached. So I put them here again. I am a newbie in LLVM and I am trying to replace the function like: old function || new function ============================== ========= int haha(int a) { int haha(int a, char* ID) { ===> }
2009 Jun 18
0
[LLVMdev] Referring to an argument in another function
Scott Ricketts wrote: > I would like to instrument certain function calls with a function call > of my own that takes some of the same arguments. For example, I would > like to instrument calls to free with some function foo, so the C code > would look like: > > foo(myarg1, myarg2, ptr); > free(ptr); > > The problem occurs when I grab the arg from the free function and
2009 Nov 11
4
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
Hi, I'm trying to add function calls in the LLVM IR using the IRBuilder class. I've read both tutorials about functions but I still get assertion errors. I allocate memory for all function arguments and pass them as explained in the tutorial. My code is (this function is supposed to add a call to f in bb at pos): void addCallSite(Function *f, BasicBlock *bb, BasicBlock::iterator pos)
2009 Apr 16
2
[LLVMdev] Patch: MSIL backend global pointers initialization
Hi Anton > > > The interesting for me part of the CallInst is printf(i8* noalias %0, i32 > > 123). > > I was diging in doxygen documentation but I really can't see the easy way > to > > compare those instructions and again finish with reinvented (but working) > > wheel ;). > Ah, sorry. I missed that you're doing variadic calls, not casting >
2011 Sep 16
0
[LLVMdev] How to duplicate a function?
Hi all, I am a newbie in LLVM and I am trying to replace the function like: old function || new function ======================================= int haha(int a) { int haha(int a, char* ID) { ===> } } Of course in the newly replaced function "int haha(int,
2008 Sep 13
3
[LLVMdev] Duplicate Function with duplicated Arguments
I'm now writing a pass and I wanna ask a question about how to duplicate the function and add duplicated arguments in llvm, for example: func(int a, char *b) -> func(int a, char *b, int a1, char *b1) I'm now stuck at using "getOrInsertFunction" and how to handle "getArgumentList", please share your opinion, thanks a lot! James
2010 Jun 09
1
[LLVMdev] Segmentation fault 'cause of accessing function arguments
Hi all, I am experimenting to run a pass inherited from CallGraphSCCPass. In the pass, I iterate all functions in a SCC. In each iteration, I access all arguments of a function in the following way: Function::arg_iterator PI = fun->arg_begin(), PE = fun->arg_end(); ... I have no trouble with building. However, I am troubled with "segmentation fault" when I run the pass
2011 Jul 06
2
[LLVMdev] First steps with LLVM and partial evaluation
Hi all, I'm rather new to LLVM and intend to dive into partial evaluation with LLVM. I tried to run the example from http://llvm.org/devmtg/2008-08-23/llvm_partial.pdf, which worked after some adaptations, which were necessary, because LLVM evolved since the slides were made. However, I also tried to get the same example running as an optimization pass following the instructions in
2009 Apr 16
0
[LLVMdev] Patch: MSIL backend global pointers initialization
Hi, Artur > // CallSites have equal signatures > bool MSILWriter::cmpCallSite(CallSite A, CallSite B) { >   return (getCallSiteFType(A)==getCallSiteFType(B) && >     A.getAttributes()==B.getAttributes()); > } As it is impossible to honour argument attributes in MSIL I don't see why you should compare attributes. You seems to have the same MSIL call signature for calls
2012 Oct 08
1
[LLVMdev] Fwd: Multiply i8 operands promotes to i32
Hello Pedro, As others have said we're assuming that you're using Clang as the frontend, the MSP430TargetInfo class inside lib/Basic/Targets.cpp (clang codebase) set ints to be 16 bits wide, so you should get 16bit mults straight away without promotion. But anyways for 8bit multiplicantions you can do the following to bypass argument promotion: 1) go to the lib/CodeGen/TargetInfo.cpp
2012 Mar 07
3
[LLVMdev] Alias analysis result
Hello everyone, I am trying to find the alias between a store instruction's pointer operand and function arguments. This is the code, virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequiredTransitive<AliasAnalysis>(); AU.addPreserved<AliasAnalysis>(); } virtual bool runOnFunction(Function &F) { AliasAnalysis &AA =
2009 Sep 06
2
[LLVMdev] Graphviz and LLVM-TV
On 2009-09-06 17:30, Ioannis Nousias wrote: > I've tried to write a DFGPrinter based on the CFGPrinter, as you > suggested, but encountered problems. > > The GraphWriter expects > GraphTraits<GraphType>::nodes_begin()/nodes_end(). The way this is > implemented in CFG.h, a function is a graph of basic blocks. A > GraphTraits<Function*> inherits from
2012 Apr 13
2
[LLVMdev] Incorrect result in LLVM Alias Analysis
It contains the bitcode file(without any optimization) of the below program, void map(int *a) { *a=20; } int main(){ int *a=(int *)malloc(sizeof(int)); *a=15; map(a); return 0; } I want to check if the pointer operand of each store instruction aliases with the function's arguments. I have used below code for this, virtual void getAnalysisUsage(AnalysisUsage &AU) const {
2012 Sep 05
2
[LLVMdev] Lowering Call Return
How about vector parameters? define internal fastcc <4 x float> @add(<4 x float> %a.val, <4 x float> %b.val) nounwind { entry: %tmp4 = fadd <4 x float> %a.val, %b.val ret <4 x float> %tmp4 } a and b are flattened by SelectionDAGISel::LowerArguments(const BasicBlock *LLVMBB) before letting the target handle it. SDValue NewRoot =
2009 Nov 11
0
[LLVMdev] Adding function call in LLVM IR using IRBuilder causes assertion error
CreateAlloca(Type) returns an object of type Type*, the memory that can hold an object of type Type. You probably don't want to be creating allocas just before calling the function since 1) if that call winds up in a loop they'll grow your stack frame without bound, and 2) the memory they point to is initially uninitialized. Where did the tutorial tell you to do that? In general, when I
2009 Nov 18
2
[LLVMdev] Strange error using CallInst constructor
Hi, This is probably more of a standard C++ question instead of an actual LLVM question, but here it goes anyway. I'm trying to invoke the following constructor: CallInst::CallInst(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, const Twine &NameStr, BasicBlock *InsertAtEnd); My code is: using namespace llvm; void replaceByClone(Function *f, CallInst *I){ Function *clone =
2011 Nov 19
2
[LLVMdev] Insert a function call in the code
Hello, everyone I am new to LLVM, now I got a problem I want to add a function call before sleep(int a, int b) code below #include <stdio.h> int sleep(int a, int b) { return a+b; } int main(int argc, char **argv) { sleep(1,2); } after use opt -load ../llvm-2.8/Release+Asserts/lib/bishe_insert.so -bishe_insert <1.bc> 2.bc I want get the code #include <stdio.h>
2009 Nov 19
0
[LLVMdev] Strange error using CallInst constructor
Please keep replies on the list. Now you've missed "InputIterator must be a random-access iterator pointing to contiguous storage (e.g. a std::vector<>::iterator). Checks are made for random-accessness but not for contiguous storage as that would incur runtime overhead." from CallInst's constructor (although that comment should be on Create()). Function::arg_iterator
2010 Jun 09
0
[LLVMdev] Segmentation fault 'cause of accessing function arguments
Hi all, I am experimenting to run a pass inherited from CallGraphSCCPass. In the pass, I iterate all functions in a SCC. In each iteration, I access all arguments of a function in the following way: Function::arg_iterator PI = fun->arg_begin(), PE = fun->arg_end(); ... I have no trouble with building. However, I am troubled with "segmentation fault" when I run the pass