similar to: Convert Register Names to String

Displaying 20 results from an estimated 300 matches similar to: "Convert Register Names to String"

2018 Nov 12
2
Convert Register Names to String
Hi Tim, Thanks for the nice answer. The code that you mentioned, seems to generate the IR. You mean I should reuse the code to extract and output the register names in a file. Next, I should postprocess the file in my own pass? Regards. On Mon, 12 Nov 2018 at 13:09, Tim Northover <t.p.northover at gmail.com> wrote: > Hi Ahmad, > > On Sun, 11 Nov 2018 at 13:39, Ahmad Nouralizadeh
2018 Aug 16
2
Convert Function Pointer Call to Function Call at the IR Level
Hi, I want to convert a function pointer call in the IR of MPlayer to a function call. For example, I have the following line: ... %10 = tail call i32 %7(%struct.demuxer* nonnull %0, i32 %1, i8* %2) #7, !dbg !863222 ... I want to set the target which is stored in %7 to a real function called "demux_lavf_control()" with the following definition: ... define internal i32
2018 Sep 03
2
Replacing a function from one module into another one
Thank you Ahmad, I figured out that, although the type of both p(oInst) and p(nInst) were the same, I had to: for (unsigned int i = 0; i < callOInst->getNumArgOperands(); i++) { callOInst->getArgOperand(i)->mutateType(callNInst->getArgOperand(i)->getType()); } that solves the issue at the calling instruction in the main function, but now I see that *linkModules* does not work
2018 Sep 02
2
Replacing a function from one module into another one
Hi Ahmad, What does that tool does besides what LLVM linker already does? I don't think my problem is in linking both modules, I think LLVM linker does the job for me, the issue is when changing the called function to call another function (in the example previously provided, to change it from foo2 to foo3, and adjusting the function parameter's references). Regards, Daniel Moya El
2018 Sep 04
2
Replacing a function from one module into another one
Hi Philip, Thank you very much for your answer, the vector declaration example worked. I'm pretty sure the ValueToValueMapTy is the last thing I need because I even saw there is another function that could help me llvm*:*:RemapFunction <http://llvm.org/doxygen/namespacellvm.html#addf0183e92893bdbcde00fc9091dda93>; but my problem is that I don't know how to populate the
2018 Sep 06
2
Replacing a function from one module into another one
Hi Philip, Thanks for the reference, I was able to follow it and copy the code that I saw necessary, but I still have some issues (references are still not updated). I created the function: void populateVMap(llvm::ValueToValueMapTy &VMap, llvm::Function *fOld, llvm::Function *fNew) { llvm::Function::arg_iterator DestI = fOld->arg_begin(); for (llvm::Function::const_arg_iterator J =
2017 Jun 05
2
Question about llvm::Value::print performance
Dear Thomas, > Hi Christoph, > > maybe there is a way of caching the print outputs and output them at the > end of the program execution? > So, your real application do not have this kind of bottle neck. this is a valid idea, thought the problem is: I output all things only "once" and I even output it like: 1) load module 2) go over functions 3) output all blocks with
2018 Sep 06
2
Replacing a function from one module into another one
Hi Philip, The error happens when the program finishes and it automatically calls the destructors, so it is not an error specifically inside my program. Here's the full code: #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/MCJIT.h" #include "llvm/IRReader/IRReader.h" #include "llvm/Support/TargetSelect.h" #include
2016 Oct 29
1
Problems with Inline ASM expressions generated in the back end
Hello. I generated in the back end by hand (in C++ code, not with TableGen) some fancy assembly code using Inline ASM expressions and if I use 2 functions in my source code (but NOT just 1 function; I will not present the functions, but each requires me to generate an Inline ASM expression) I get this error at compilation (at scheduling): BB#0: derived from LLVM BB %entry
2018 Aug 08
3
Error Calling eraseFromParent()
LLVM is built in Release mode. The version is 6.0.0. I think that a similar code worked on verison 3.9.0. It is probably a null pointer dereference occurring in eraseFromParent(). I checked and reconfirmed that the instruction had no uses. Perhaps I should rebuild LLVM. Thanks. On Wed, Aug 8, 2018 at 9:03 PM, mayuyu.io <admin at mayuyu.io> wrote: > Hmmmm that’s strange. Do you get an
2018 Aug 08
2
Error Calling eraseFromParent()
Hi. Thanks. I changed the code but the problem exists. This is my new code which is again very simple: ... bool runOnFunction(Function &F) override { vector<Instruction *> dels; dels.clear(); for (inst_iterator It = inst_begin(&F), Ie = inst_end(&F); It != Ie;) { Instruction *I = &*(It++); if (auto* op = dyn_cast<BinaryOperator>(I)) { IRBuilder<NoFolder>
2017 Jun 05
2
Question about llvm::Value::print performance
Hi, I want to use llvm::Value::print to output the assembly strings for llvm::Instructions inside a rather large llvm::Module (linked module with lots of types/...). I started with plain ::print and switched over to http://llvm.org/docs/doxygen/html/classllvm_1_1Value.html#a04e6fc765eeb0c4c90ac5d55113db116 with a ModuleSlotTracker I pass in myself to avoid some complexity. Still now I have
2015 Oct 05
6
Why is printing an Instruction so slow?
Hi all, When writing my custom passes, I often emit log messages to llvm::errs() like so: llvm::errs() << "Could not handle instruction: " << *Inst << std::endl; where Inst is a pointer to an Instruction. I've profiled my code and found that this way of printing an Instruction takes a very long time: indeed, it is the bottleneck of my pass. Of course, I could
2018 Aug 07
2
Error Calling eraseFromParent()
Thanks Bjorn! But The problem is still there. On Wed, Aug 8, 2018 at 2:04 AM, Björn Pettersson A < bjorn.a.pettersson at ericsson.com> wrote: > It looks quite dangerous to erase the instruction I inside the loop when > iterating over all instructions in the function. > I guess it depends on how the range based iterator is implemented if that > works or not. > > I think
2018 Aug 07
2
Create an Add Instruction in LLVM IR
I want to create an add instruction that takes two constant operands at the LLVM IR level. I use the IRBuilder class, but nothing happens. Here is part of the runOnFunction() method of my function pass: ... LLVMContext &Context = F.getContext(); IRBuilder<> builder(&Instruction); Value *Lef = ConstantInt::get(Type::getInt32Ty(Context), 4); Value *Rig =
2018 Aug 07
2
Error Calling eraseFromParent()
The code is really simple. But I can not the reason for the segmentation fault. I only know that the eraseFromParent() function leads to it. The whole code is: ... bool runOnFunction(Function &F) override { for (auto &I : instructions(F)) { if (auto* op = dyn_cast<BinaryOperator>(&I)) { IRBuilder<> builder(op); Value* lhs = op->getOperand(0); Value* rhs =
2018 Aug 07
2
Error Calling eraseFromParent()
Hi. This is part of my code: ... if (auto* op = dyn_cast<BinaryOperator>(&I)) { Value* lhs = op->getOperand(0); Value* rhs = op->getOperand(1); Value* mul = builder.CreateMul(lhs, rhs); for (auto& U : op->uses()) { User* user = U.getUser(); user->setOperand(U.getOperandNo(), mul); } I.eraseFromParent(); } ... This leads to the following
2018 Sep 02
2
Replacing a function from one module into another one
Hello and thanks for the answer, I'm still facing issues, I'll do my best to explain my situation, as I explained, I have two modules, each one with its own main and functions, I would like to replace in the *oldModule* a function call that is calling *foo2* (defined in *oldModule*) to instead call *foo3*, which is defined in the *refModule. *So in summary, I have: 1. The original
2006 May 31
1
tweaking wine - picasa version
Hello, I installed picasa and this installed a customized version of wine too. Picasa works very well and so I have the hope that other graphic editors could work well with this wine-version too. I want to run Photoline32 (available at http://www.pl32.com) I dont understand much about wine and the scripts delivered with the picasa-version are rather complicated - almost unreadable for me ;-)
2019 Jul 29
5
Arguments name IR LLVM
Hi everybody, I want to read the name of the arguments of fucntion IR LLVM, I have the following function define: define void @vecadd(i32, float* nocapture readonly, float* nocapture readonly, float* nocapture) local_unnamed_addr #0 { As we see, the argument has no name, if we look at call function in main function we see the arguments name (a, b and c): call void @vecadd(i32 10, float*