similar to: [LLVMdev] modify instructions

Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] modify instructions"

2002 Sep 26
2
[LLVMdev] modify instructions
Hi, I have a question about the modify of instruction: Say I want to modify %a = getelementptr %struct %S, long 0, ubyte 1 into %a.f0 = getelementptr int* %S.f0, long 0 There are 3 ways I can think of to implement, but I'm not sure what should I do. 1. I can use new GetElementPtr to create a new instruction and use ReplaceInstWithInst() function to replace the old one. 2. I can use new
2002 Oct 31
1
[LLVMdev] problems with llvmgcc
Dear Prof. Adve, Now I can use llvmgcc to compile a .c file into .bc file. But I still have trouble simply run the .bc code. Below is the sequence I got when I tried. I really don't know what's going on here. Please let me know how can I fix it. Thanks, xiaodong xli3|csil-suna48|~/cs426|[13]% llvmgcc scalarize.c -o scalarize xli3|csil-suna48|~/cs426|[14]% scalarize Cannot load value of
2002 Nov 11
1
[LLVMdev] DSGraph questions
Dear Prof. Adve, I recently checked out the llvm using cvs update command under the llvm directory. But when I went to see the DSNode.h, there is no getPointerSize function. I checked the doxygen tree, it's there. So that means I didn't update my cvs tree correctly. Could you let me know how to update my CVS tree? Or there is a problem at somewhere else? Thanks, xiaodong On Sun, 10 Nov
2016 Jun 21
3
function call replacement
Hi, Thanks both of you for the help. I just missed that Create function had many optional arguments... sorry for that. However my problem wasn't coming from here (IRBuilder CreateCall function still return a pointer to CallInst so I just added 2 times the call?). I didn't wanted to detail the all issue previously because I knew I had a problem with my syntax. So here's my problem: I
2016 Jun 20
3
function call replacement
Hi everyone, I am trying to replace the call of a certain function with a call to another function. It would for example replace the following: %call = tail call noalias i8* @func(i64 10) by %call = tail call noalias i8* @other_func(i64 10) I managed to declare other_func correctly but I am having troubles to understand how I should proceed to do the replacement. I tried to use
2002 Oct 30
2
[LLVMdev] problems with llvmgcc
Thanks, Chris, Below is the output of 'llvmgcc he.c -v' xli3|csil-suna27|~/cs426|[35]% llvmgcc he.c -v Reading specs from /usr/dcs/projects/cs426/Software/gcc_install/bin/../lib/gcc-lib/llvm/3.1/specs Configured with: /home/vadve/lattner/cvs/gcc/configure --srcdir=/home/vadve/lattner/cvs/gcc --prefix=/home/vadve/lattner/cvs/gcc_install_sparc --target=llvm --enable-languages=c
2002 Oct 30
0
[LLVMdev] problems with llvmgcc
The problem with llvmgcc invoking as instead of llvm-as has been fixed. 3 llvm-specific executables needed to be copied into a default location where gcc can find them if it does not find them as configured (gcc was configured for the paths on our research machines and copied over). Let us know if you have additional problems. --Vikram > -----Original Message----- > From: llvmdev-admin
2002 Sep 26
1
[LLVMdev] ReplaceUsesWith
When I try to do this: GetElementPtrInst *newIns = new GetElementPtrInst( ... ); OldIns->ReplaceAllUsesWith( newIns ); When I compile the code, it always says, no matching function for call to `GetElementPtrInst::ReplaceAllUsesWith (GetElementPtrInst *&)' But since GetElementPtrInst is a subclass of Value, why cannot use this way? What's wrong here? thanks, xiaodong
2002 Sep 17
3
[LLVMdev] questions
Sorry I got really overwhelmed by so many classes and member functions in LLVM. So would you please clarify some problems I have? 1. If I see this instruction in the function. %S.i = alloca %struct.SimpleStruct Suppose SimpleStruct is as following: struct.SimpleStruct = type { int, double } When I read the instruction, how can I know the type of simplstruct, should I use 'getType'
2002 Sep 25
3
[LLVMdev] question about GetElementPtr Instruction
I have a question about GetElementPtr. Suppose I have an GetElementPtr Instruction GI: %reg = getelementptr %ST* %s, uint 1, ubyte 2, ubyte 1, uint 5, uint 13 I want to check if this is the reference of a component of a structure, how can I do that? Should I check which operand of this instruction is 'ubyte' type? How can I do that in code? should I use ubyte *a =
2002 Nov 14
1
[LLVMdev] problem checking out llvm
When I check out llvm this morning. I got this error, so I couldn't check out. Looks like the disk is full.. Please let me know how to fix this problem. Thanks, xiaodong xli3|csil-suna33|/usr/dcs/projects/cs426/xli3/llvm|[10]% cvs update cvs update: Updating . ? gnumake.out cvs update: Updating Support cvs update: Updating include cvs update: Updating include/Support cvs update: cannot close
2002 Sep 16
4
[LLVMdev] another question
In the section expaining "dyn_cast" There are following lines of code: if (AllocationInst *AI = dyn_cast<AllocationInst>(Val)) { ... } I cannot understand how you take a operand, a value, and cast it into a Instruction. Can you explain it for me? Another common example is: // Loop over all of the phi nodes in a basic block BasicBlock::iterator BBI =
2002 Nov 10
0
[LLVMdev] DSGraph questions
I'll try to answer these because Chris is really busy this week. > From: Xiaodong Li <xli3 at santoor.cs.uiuc.edu> > Subject: [LLVMdev] DSGraph questions > Sender: llvmdev-admin at cs.uiuc.edu > Date: Sun, 10 Nov 2002 11:25:53 -0600 (CST) > > 1. What is the difference between DSNodeHandle and DSNode? What do the > functions getLink() and getSize() do?
2002 Nov 10
3
[LLVMdev] DSGraph questions
1. What is the difference between DSNodeHandle and DSNode? What do the functions getLink() and getSize() do? 2. In the previous email, you mentioned that we can use DSNode::getPointerSize() to get the number of links, But I checked the doxygen documentation, there is no such member for DSNode. 3. Previously I use the following code: for( df_iterator<DSNode*> I = df_begin(pnode),
2015 Jun 18
3
[LLVMdev] problem with replacing an instruction
I am trying to change this define void @main(float* noalias %arg0, float* noalias %arg1, float* noalias %arg2) { entrypoint: %0 = bitcast float* %arg1 to <4 x float>* intothis define void @main(float* noalias %arg0, float* noalias %arg1, float* noalias %arg2) { entrypoint: %0 = getelementptr float* %arg1, i64 0 %1 = bitcast float* %0 to <4 x float>* I must be close but
2002 Nov 01
2
[LLVMdev] totally lost
Dear LLVM: I wrote a small testcase and I can compiler and run it with gcc, But with llvm, I got weird error like the following. I really don't know what's going on. Could you explain? Thanks a lot -Jerry Error Message: xli3|csil-suna38|~/mp2|[25]% llvmgcc testcase3.c testcase3.c: In function `init': testcase3.c:5: warning: cast to pointer from integer of different size
2019 May 17
3
Copy Function from one LLVM IR file to another
Hello everyone, I wanted to copy a function from one file to another. The file that I wanted to copy the function into contains a function with the same name and same number of instructions. I decided to just replace the instructions with those of the other function. I am doing all of this from within a function pass. *1.* I created a function pass in which I extract a function using
2013 Dec 06
0
[LLVMdev] ReplaceInstWithInst problem
Hi, In my source code, I have the following declaration char a[30]; When I'm running the following (Assuming that I is an instruction pointer pointing to the instruction to be replaced, i.e. %a = alloca [30 x i8], align 1): ArrayType* arr = ArrayType::get(IntegerType::get(getGlobalContext(), 8), 10); AllocaInst* pa = new AllocaInst(arr, "blah"); BasicBlock::iterator ii(*I);
2014 Jun 29
2
[LLVMdev] Wrong behavior modifying and executing llvm::Function with JIT Engine
getFunction() -> getPointerToFunction() 2014-06-29 6:40 GMT+03:00 Yaron Keren <yaron.keren at gmail.com>: > Hi Adrian, > > freeMachineCodeForFunction is required but recompileAndLinkFunction is > not, > you can use getFunction() always. > > Try to M->dump() calling M->getFunction() where M is the Module *. > See if how the changes appear in the module
2011 May 06
1
[LLVMdev] ReplaceInstWithInst appears to invalidate BB iterator?
Hello, I have a call to ReplaceInstWithInst(Instruction *From, Instruction *To) inside of a for loop iterating through a BasicBlock::iterator. On the very next pass after I replace the instruction, the iterator appears to be invalidated. Is this supposed to happen or am I doing something silly? Is there a more appropriate way to do this? Thanks, -Justin