similar to: [LLVMdev] small bug in print function for arguments

Displaying 20 results from an estimated 20000 matches similar to: "[LLVMdev] small bug in print function for arguments"

2009 Sep 28
0
[LLVMdev] Printing Function Arguments
Hi Nick, Perhaps I am confused. What is the best way to extract information from instructions ? Is it via the, say: for (User::op_iterator i = I->op_begin(), e = I->op_end(); i != e; ++i) .... I am not sure what happens next, e.g. to the variable 'i', you should know what part of the instruction this is and cast it to the necessary type. For example, I am parsing the
2006 Apr 19
3
[LLVMdev] 1.7 Pre-Release Ready for Testing
On 4/19/06, Patrick Meredith <pmeredit at uiuc.edu> wrote: > I haven't seen anyone claim x86 linux objdir == srcdir, so I'll test it out. > Missed the 18th,but I'll try to have it done asap. > > > On Apr 18, 2006, at 2:51 PM, Robert L. Bocchino Jr. wrote: > I'll test on Darwin/PPC, precompiled llvmgcc, objdir == srcdir. > > Rob > Sorry for being
2018 Apr 07
1
Print emory for constant address
Hi all, Consider a simple ll code: %2 = load i32* %y, align 4 I intend to get the memory address of %2. if(isa<loadInst>(I)){ // variable name:y value v = I.getOperand(0); // ? I shows the entire instruction, not %2, then I.getName() would print an empty space which is %2, but I can’t get the memory when dereferencing it errs()<< *&(I.getName())<<"\n”; } error:
2017 Mar 10
2
get function parameters (not arguments)
I tried the original posted code again: for (auto& A : cast<CallInst>(BI)->arg_operands()) errs() << "--- " << A->getName() << "\n"; but it prints empty (only ---)! Thank you and best, Mo On Fri, Mar 10, 2017 at 4:44 PM, Tim Northover <t.p.northover at gmail.com> wrote: > On 10 March 2017 at 15:41, Mohammad Norouzi <mnmomn at
2017 Mar 10
2
get function parameters (not arguments)
Sorry i'm using the following code: F = (cast<CallInst>(BI))->getCalledFunction(); for (auto& A : F->getArgumentList()) { errs() << "------- " << A.getName() << " " << "11" << "\n"; } But how can I get the parameters (as e and f in the example)? Thank you and best, Mo On
2011 Sep 22
2
[LLVMdev] How to const char* Value for function argument
Hi, I'm trying to replace function call with call to wrapper(function_name, num_args, ...), where varargs hold args of original call. Function* launch = Function::Create( TypeBuilder<int(const char*, int, ...), false>::get(context), GlobalValue::ExternalLinkage, "kernelgen_launch_", m2); { CallInst* call = dyn_cast<CallInst>(cast<Value>(I)); if
2011 Sep 22
0
[LLVMdev] How to const char* Value for function argument
Hi Dimitry, This makes sense if you think about it from the perspective that the string you want passing must be passed at runtime, and so can't use a const char * from compile time. You need to make the string visible in the compiled image, and use that as the argument. A string is an array of 8-bit integers, so you need to create a ConstantArray. Value *v = ConstantArray::get(Context,
2009 Sep 28
4
[LLVMdev] Printing Function Arguments
ivtm wrote: > Hey Oscar, > > I want to extract information from the instruction. > > Think writing a simple interpreter. > > I already have the CallInst instance (described above in the message). > > Via ci->getOperand(1) say I can get the 'i32 8' parameter and I can get the > 'i32' and '8' separately as Nick described. > > But I
2004 Jun 23
3
[LLVMdev] IRC: Discussion About Upgrades To Bugzilla
I thought this conversation was worth saving. DannyB who did wonderful things with GCC's use of bugzilla has offered the same capability to LLVM. Thanks, Danny! <DannyB> sabre: BTW, if you need any of the bugzilla fun i have implemented for gcc, let me know [22:47] <sabre> Cool, what kinds of things do you have? [22:47] <DannyB> Besides the triplet stuff, i changed some of
2004 Jun 23
2
[LLVMdev] weird issue with mem2reg, still
On Wed, 23 Jun 2004, Patrick Meredith wrote: > Somehow it fails with operand out of bounds when the number of operands > is 2 and I am asking for the second operand. Second meaning operand 1. Okay, so you have something like this: if (CallInst *CI = dyn_cast<CallInst>(...)) { ... = CI->getOperand(1); } Can you send in this snippet of code, the assertion, and the
2004 Jun 23
0
[LLVMdev] weird issue with mem2reg, still
void MetaSplit::handleProgramUses(Value *V){ if(!isa<BasicBlock>(V)) programValues.insert(V); if(User *U = dyn_cast<User>(V)){ User::op_iterator OB = U->op_begin(), OE = U->op_end(); for(; OB != OE; ++OB){ if(CallInst *CI = dyn_cast<CallInst>(*OB)){ Function *F = CI->getCalledFunction(); if(F == ii || F == fi || F == vi || F == di || F == ci
2004 Jun 23
2
[LLVMdev] weird issue with mem2reg
On Wed, 23 Jun 2004, Patrick Meredith wrote: > MetaSplit is an anlysis I just finished writing. It doesn't alter anything, > all it does is build a set of "program instructions". For some reason even > though if I run it with any other combination of passes I've found, anytime > I run it with mem2reg I get a seg fault in dyn_cast! Here's output: > >
2011 Jan 18
0
[LLVMdev] How to get the name and argument of a function
songlh at cs.wisc.edu wrote: > Hi everyone: > > The code I am analyzing is : > > int main() > { > int i = 0; > printf("hello world!"); > printf( "%d" , i ); > } > > > > I want to get each place where printf is called, and the argument used > during that call. > > so I write llvm
2009 Aug 04
3
[LLVMdev] Outputting hex in DOUT's
On Tuesday 04 August 2009 18:24, Chris Lattner wrote: > The big issue is things like this: > > DOUT << foo.getName() << "\n"; > > When -debug is disable and even when assertions are turned off, > foo.getName() is still called. When you use: Yep, that's a problem. > DEBUG(errs() << foo.getName() << "\n"); > > When
2013 Jul 22
0
[LLVMdev] Analysis of polly-detect overhead in oggenc
At 2013-07-22 01:40:31,"Tobias Grosser" <tobias at grosser.es> wrote: >On 07/21/2013 09:49 AM, Star Tan wrote: >> Hi all, >> >> >> I have attached a patch file to reduce the polly-detect overhead. > >Great. > >> My idea is to avoid calling TypeFinder in Non-DEBUG mode, so >> TypeFinder is only called in DEBUG mode with the DEBUG
2008 Jul 17
3
[LLVMdev] SSA or not SSA?
[ sorry for the late reply ] Patrick Meredith <pmeredit at uiuc.edu> wrote: > All register uses are SSA. Memory is not in SSA. The mem2reg pass > which promotes stack variables to registers effectively converts non- > SSA to SSA. There was a reg2mem pass, written by Andrew Lenharth, I'm > not sure if it's still being maintained. What is the difference between
2004 Jun 23
0
[LLVMdev] weird issue with mem2reg
MetaSplit is an anlysis I just finished writing. It doesn't alter anything, all it does is build a set of "program instructions". For some reason even though if I run it with any other combination of passes I've found, anytime I run it with mem2reg I get a seg fault in dyn_cast! Here's output: Starting program: /mounts/zion/disks/0/localhome/pmeredit/llvm/tools/Debug/opt
2012 Jul 05
0
[LLVMdev] Accessing Return Variable Names
Hi John, %4 is not returned, because it's a temp register value and not a named variable. But you can implement something like the code below to get this value. (Not the most elegant, but more or less working solution). static std::string getName(Instruction* i) { if(i->getOpcode() == Instruction::Store) { return
2008 Jul 17
2
[LLVMdev] SSA or not SSA?
Patrick Meredith <pmeredit at uiuc.edu> writes: > Memory is what the i32* points too. The i32* itself is in a > register. You can store to it as many times as you want, but you > can't change the address, because that would violate SSA. Thanks, For the record, I finally understood by making a few experiments: This is (obviously) valid: define i32 @main() {
2009 Sep 04
2
[LLVMdev] Error in Hello World Pass
Hi, I am trying to compile the Hello World pass (described at http://llvm.org/docs/WritingAnLLVMPass.html#basiccode) in an LLVM Project and I get an error, 'no match for ‘operator<<’ at line llvm::cerr << "*Hello: *" << F.getName() << "\n"; But when I looked up in the LLVM API Documentation, I think "<<" operator is not overloaded