similar to: [LLVMdev] Loops over operands

Displaying 20 results from an estimated 5000 matches similar to: "[LLVMdev] Loops over operands"

2005 Jul 12
0
[LLVMdev] Getting started with LLVM Passes
Chris, I've now figured out how to track and single out specific instructions, which was ridiculously easy. Thanks! I'm now on to trying to find more detail about those instructions, such as the values and addresses of the operands in memory (or, in the case of operands which are pointers, trying to get the pointer values, addresses, and values stored at location specified by
2004 Oct 12
1
[LLVMdev] Re: Hide visible string in variable (Chris Lattner)
Hi, Thanks so much at first. > Here are some observations: > > > for C level, > > > > char a[]="global string test"; > > for(i=0;i<strlen(a);i++){ > > a[i]= a[i]^RANDMON; > > } > > If you compile this C code, "global string test" will occur in the program > binary, so you have not obfuscated anything. You can
2008 Jan 14
0
[LLVMdev] Extraction of constant operands from the instruction
Hi all, I am trying to extract the operands from an instruction, for that i am iterating over the operand list as defined by the user class. for (User::op_iterator O = i->op_begin() ;O != i->op_end(); ++O) { Value *v = *O; llvm::cout << v->getNameStr() ; } However, whenever there is a constant operand like a numerical value, it does not displays any value at all, i checked
2009 Sep 28
0
[LLVMdev] Printing Function Arguments
Hi Nick, I parsed your message again carefully and did some experiments. I guess the: for (User::op_iterator i = I->op_begin(), e = I->op_end(); i != e; ++i) { } iterates over the operands of the instruction "I", which are as you said, *other* instructions. But if I want to get other information about the instruction, say the type of the operands, then I still need to figure
2008 Apr 29
0
[LLVMdev] [PATCH] use-diet for review
On Apr 29, 2008, at 1:27 AM, Gabor Greif wrote: > Hi all, > > I have reported more than enough about the space savings achieved > and the associated costs, here comes the current patch for review. > > Since this one is substantially smaller than the previous one, I did > not cut it in pieces. The front part is about headers and the rest > the .cpp and other files. Hi
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 Mar 03
1
[LLVMdev] printing constants
Sir, I am using the op_begin and op_end iterator for iterating over the operands as mentioned below. for (User::op_iterator operand=j->op_begin(),operand_end=j->op_end();operand!=operand_end;++operand){ Value *v=operand->get(); const Type *t=v->getType(); cerr<<endl<<" operand: "<<"[ "<<v->hasName()<<"
2013 Feb 16
1
[LLVMdev] A weird problem when try to output operand of instruction involving function pointer in a struct
Hi all, I just start to learn llvm. I am trying to get the operand's name of some instruction that invokes a function field of a struct. While, I found in the result that there is a sequence number attached to the function field name. Below is an example: /******source code t2.c*******/ #include <stdio.h> void F(){printf("F\n");} void E(){printf("E\n");} void
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
2011 Dec 09
1
[LLVMdev] Finding the uses of a global variable
Hi everyone, I am writing a pass that finds all uses of global variables (my goal is to find the uses of strings, and strings are defined as global variables). So, I can iterate over global vars by for(Module::global_iterator gi = M.global_begin(), gend = M.global_end(); gi != gend; ++gi) ...... But if I use its def-use chain for(Value::use_iterator i = gi->use_begin(), e = F->use_end; i!=e;
2012 Oct 31
1
[LLVMdev] Lifetime analysis of variables within a module
Hi all, I'm looking for a LLVM method/class/strategy to know the lifetime of every variable/value used in a given Module. I want to know the variables that must be alive at the input and at the end of every function call (and every BasicBlock). By creating a pass inheriting from ModulePass I can reach up to here: virtual bool runOnFunction(Function &F) { ... for
2010 Jan 10
1
[LLVMdev] [PATCH] Fix nondeterministic behaviour in the CodeExtractor
On Fri, Jan 08, 2010 at 05:04:17PM -0800, Chris Lattner wrote: > On Jan 8, 2010, at 5:01 PM, Julien Lerouge wrote: > >Hello, > > > >The CodeExtractor contains a std::set<BasicBlock*> to keep track > >of the > >blocks to extract. Iterators on this set are not deterministic, and so > >the functions that are generated are not (the order of the >
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,
2013 Aug 02
1
[LLVMdev] replacing GetElementPtrConstantExpr with GetElementPtrInst ... sometimes
Hi During a pass, the XCore target lowers thread local global variables by turning them into global variable arrays indexed by the (max 8) thread ID. (see XCoreLowerThreadLocal.cpp) This works fine for instructions e.g. GetElementPtrInst But can't be done for constants e.g. GetElementPtrConstantExpr Thus I would like to replace GetElementPtrConstantExpr with GetElementPtrInst when it is
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
2011 Nov 21
0
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
Tobias, I've attached an updated patch. It contains a few bug fixes and many (refactoring and coding-convention) changes inspired by your comments. I'm currently trying to fix the bug responsible for causing a compile failure when compiling test-suite/MultiSource/Applications/obsequi/toggle_move.c; after the pass begins to fuse instructions in a basic block in this file, the aliasing
2015 Sep 13
3
RFC: faster simplifyInstructionsInBlock/SimplifyInstructions pass
LLVM has two similar bits of infrastructure: a simplifyInstructionsInBlock function and a SimplifyInstructions pass, both intended to be lightweight “fix up this code without doing serious optimizations” functions, as far as I can tell. I don’t think either is used in a performance-sensitive place in-tree; the former is mostly called in minor places when doing CFG twiddling, and the latter seems
2018 May 21
2
Getting variable names from LLVM Pass
Hi, I want to retrieve the variable names used in a statement, I tried the following snippet, but it only gives me the variable named in llvm bitcode. I need the variable name in source code. for (auto op = I.op_begin(); op != I.op_end(); op++) { Value* v = op->get(); StringRef name = v->getName(); } Is there specific documentation I can
2007 Sep 24
0
[LLVMdev] RFC: Tail call optimization X86
Hi Arnold, This is a very good first step! Thanks! Comments below. Evan Index: test/CodeGen/X86/constant-pool-remat-0.ll =================================================================== --- test/CodeGen/X86/constant-pool-remat-0.ll (revision 42247) +++ test/CodeGen/X86/constant-pool-remat-0.ll (working copy) @@ -1,8 +1,10 @@ ; RUN: llvm-as < %s | llc -march=x86-64 | grep LCPI | count 3 ;