similar to: [LLVMdev] Re: global variable

Displaying 20 results from an estimated 20000 matches similar to: "[LLVMdev] Re: global variable"

2006 Jun 06
0
[LLVMdev] Re: global variable
On Tue, 6 Jun 2006, Lan Bai wrote: > Hi Chris, I want to use some new call inst to initialize some new global > variables at runtime (assign the return value of the call inst to the global > variable). > > Now I have successfully inserted the new global variables to the global list, > and inserted the new call instructions to the instruction list. But I don't > know
2006 Jun 30
1
[LLVMdev] instruction sequence
I'm trying to insert a call to fprintf(stderr, ...). I've looked at the emitted assembly from llvm-gcc, and it consists of a LoadInst (of stderr) and CallInst. It looks like this: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %tmp.1 = load %struct._IO_FILE** %stderr ; ty=%struct._IO_FILE* %tmp.0 = call int (%struct._IO_FILE*, sbyte*, ...)* %fprintf(%struct._IO_FILE* %tmp.1, sbyte*
2004 Oct 10
1
[LLVMdev] Re: Hide visible string in variable
Hi, > On Mon, 27 Sep 2004, Zhang Qiuyu wrote: > > > Is there a way to modify the string such as char a or char b? Could I > > use the way like "Replace an instruction with another Value" in Programm > > Manual? In fact, what I am interested in is string with visible > > expression, not all string, and I am trying to hide the orignal string > > by
2020 Jun 03
2
Fwd: I cannot change value of global variable in LLVM IR using IRBuilder
I don't think it's the same problem as you described. By printing I meant calling printf function and passing my global variable as one of the arguments. My code: Instruction* InstructionVisitor::incrementGlobalKey(Instruction* I) { IRBuilder<> Builder(I->getContext()); Builder.SetInsertPoint(I->getNextNode()); GlobalVariable* key =
2012 Jul 31
3
[LLVMdev] rotate
Andy, Here is the left circular shift operator patch. I apologize to the reviewer in advance. The patch has a good bit of fine detail. Any comments/criticisms? Some caveats... 1) This is just the bare minimum needed to make the left circular shift operator work (e.g. no instruction combining). 2) I tried my best to select operator names in the existing style; please feel free to change them as
2004 Jul 22
2
[LLVMdev] GC questions.
Ok, here's the new patch. (Please tell me if I shouldn't mail patches directly on the mailing list.) While I was editing LowerGC.cpp I made a little test (not part of this patch, but the diff with LowerGC.cpp in cvs is attached). I've added a new intrinsic called llvm.gcroot_value(sbyte*, sbyte*), which takes a pointer directly instead and transforms it into an alloca. The idea is the
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
2009 Sep 02
0
[LLVMdev] [PATCH] PR2218
On Sep 2, 2009, at 1:07 AM, Jakub Staszak wrote: > Hello, > > I fixed my patch as you asked. Sorry for the delay, I'd been working > on my SSU patch (http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-August/025347.html > ) > > I hope that everything is fine now. Hey Jakub, Thanks for working on this again, one more round :) Please merge the three testcases into one
2012 Dec 05
0
[LLVMdev] how to get and modify a global variable inside a module
Hi Dong Chen, I realized you are actually executing the IR, right? I am not sure if the things I mentioned apply in that case. Actually, I wrote a optimization pass that modify the IR. It modifies global variables and the final IR is intended to be compiled. A snippet of what I do looks like this: class TestClass : public llvm::ModulePass { public: TestClass() : llvm::ModulePass(TestClass::ID)
2008 Dec 05
1
[LLVMdev] replacing a global variable by a constant
Thanks a lot for your help Matthijs! :) basically this does the job quite nicely I think: for (llvm::GlobalVariable::use_iterator U = gv->use_begin(); U != gv->use_end(); ++U) { llvm::Instruction *I = llvm::cast<llvm::Instruction>(U); I->replaceAllUsesWith(constPtr); I->eraseFromParent(); } Cheers, Ralf Matthijs Kooijman wrote: > Hi Ralf, > > >> I
2011 Nov 17
2
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
On 11/17/2011 12:38 AM, Hal Finkel wrote: > Tobias, et al., > > Attached is the my autovectorization pass. Very nice. Will you be at the developer summit? Maybe we could discuss the integration there? Here a first review of the source code. > diff --git a/docs/Passes.html b/docs/Passes.html > index 5c42f3f..076effa 100644 > --- a/docs/Passes.html > +++ b/docs/Passes.html
2012 Jan 03
2
[LLVMdev] AliasAnalysis and memory dependency
Hi all, I want to find memory dependency between CallInst instruction and other. So i used the following code: * AliasAnalysis &AA=getAnalysis<AliasAnalysis>();* * if(isa<StoreInst>(inst1)){* * ** **if(isa<CallInst>(inst2))**{* * CallInst *call_inst2= dyn_cast<CallInst>(inst2); * * if(AA.getModRefInfo(inst1,call_inst2)==mod)**{* *
2006 Mar 27
1
[LLVMdev] could you give me some advice ?
excuse me for bother you again . a little supplement Constant* c = findValue(m,"E1$entry"); Constant* c2 = findValue(m,"E1$str"); I can get string object from c2 string s = cast<ConstantArray>(c2)->getAsString(); but it is not applicable for c string s= cast<ConstantArray>(c)->getAsString(); // Assert Fail because c is ConstantExpr::GetElementPtr
2017 Apr 28
2
How to get the address of a global variable in LLVM?
Let `x` be the address of a global variable `g` in a program at run-time. LLVM IR produces a store instruction as shown below: store i32 30, i32* @g, align 4 I am writing an LLVM pass which will instrument the program such that `x` is passed to an instrumentation function `func(int addr)` at run-time. I can insert a call to `func` using `IRBuilder` successfully. What I am not being able to
2005 Apr 11
0
[LLVMdev] JIT and array pointers
On Mon, 11 Apr 2005, dummy1 at boxpl.com wrote: >> There are many possible ways to do this, can you be a bit more specific >> about what you're trying to do? > Here is a basic example: Ah, ok, I see what you're trying to do. Below is some *pseudo* code for the basic idea: > ============================================ > unsigned int buff[4096]; > > int main
2015 Mar 07
2
[LLVMdev] cannot understand global c++API code
Hi all, translating the following c code to llvm c++Api code, I can not understand the result. Perhaps someone could explain it to me. c code --------------------------------- struct stest { int age; float weight; } foo={44,67.2}; int main() { foo.weight=68.2; ... ---------------------------------------- API code // this is clear ConstantFP* const_float_102 =
2005 Apr 11
2
[LLVMdev] JIT and array pointers
On Sun, 2005-04-10 at 19:47 -0500, Chris Lattner wrote: > On Mon, 11 Apr 2005, Paul wrote: > > I'm trying to pass an array pointer to my run-time generated module, and > > after a long time of searching for the answer, the only thing I got was > > a headache. Basically I have a few arrays (few megabytes which will > > sometimes be accessed as 8 / 16 / 32 / 64 bit
2013 Sep 10
1
[LLVMdev] Global Variable Recall
Hi All, I need to call global variable by its name from the following code for(Function::iterator i=F->begin();i!=F->end();++i) { BasicBlock*Bb =&*i; GlobalVariable* GV = new GlobalVariable(type,false, F->getLinkage(),0, "F$"+Bb->getName()); GV->setInitializer(Constant::getNullValue (typ)); GList.push_back(GV); } Could I solve that by
2006 Mar 25
1
[LLVMdev] could you give me some advice ?
hi I have one llvm program like this : ... ; define ConstantArray "E1$str" = internal constant [3 x sbyte] c"E1\00" ; use getPtrPtrFromArrayPtr to define SByte* from ConstantArray "E1$entry" = internal constant sbyte* getelementptr ([3 x sbyte]* "E1$str", uint 0, uint 0) ... when i want to get std::string object from this declaration in
2008 Nov 17
2
[LLVMdev] Assertion `castIsValid(getOpcode(), S, Ty) && "Illegal BitCast"' failed.
ok.. So I am trying out what you have suggested. I have written the below code which basically tries to write the constant 10 to a file. myprint is a function pointer to a function which takes char * parameter and writes it to file. Value *Ten = ConstantInt::get(Type::Int32Ty, 10); const Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty); AllocaInst *AI = new AllocaInst(Type::Int32Ty); Value