search for: replacealluseswith

Displaying 20 results from an estimated 270 matches for "replacealluseswith".

2017 Aug 16
2
Inst->replaceAllUsesWith and uses in ConstantExpr
Hello all, >From what I have observed, using `Inst->replaceAllUsesWith` does not replace uses of the `Inst` in `ConstantExpr`s. Is there some way to have a universal replaceAllUsesWith? Thanks, ~Siddharth. -- Sending this from my phone, please excuse any typos! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org...
2017 Aug 17
2
Inst->replaceAllUsesWith and uses in ConstantExpr
Whoops, sorry, I meant "value->replaceAllUsesWith". Should I create a new post with an updated title? Thanks Siddharth On Thu 17 Aug, 2017, 01:05 Tim Northover <t.p.northover at gmail.com> wrote: > On 16 August 2017 at 15:39, (IIIT) Siddharth Bhat via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > From what I h...
2019 Jan 14
3
Function - replaceAllUsesWith
Hello LLVM-World, currently I play around with a "llvm::Module" and an external function defined there "puts". Normally this function gets resolved in the JIT-Process but I wonder about two things: 1. Can I resolve the function already in this step? I used "replaceAllUsesWith" and passed a "llvm::ConstantInt" to the function. But this didn't worked. 2. What might happen if I have two modules and use "replaceAllUsesWith" on a function of Module A, passing a function of Module B. Thank you for the help in advance! Kind greetings Björn Als...
2017 Aug 17
3
Inst->replaceAllUsesWith and uses in ConstantExpr
...onstantExpr that references the one you're changing. And that > would continue rippling outward. > > ~Craig > > On Wed, Aug 16, 2017 at 5:01 PM, (IIIT) Siddharth Bhat via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Whoops, sorry, I meant "value->replaceAllUsesWith". >> >> Should I create a new post with an updated title? >> >> Thanks >> Siddharth >> >> On Thu 17 Aug, 2017, 01:05 Tim Northover <t.p.northover at gmail.com> wrote: >> >>> On 16 August 2017 at 15:39, (IIIT) Siddharth Bhat via llv...
2015 Jan 17
2
[LLVMdev] Assertion: replaceAllUses of value with new value of different type! being thrown all of a sudden
Hello, I wonder if someone would know what is going on below. All of a sudden I’m getting this assertion thrown: Assertion failed: (New->getType() == getType() && "replaceAllUses of value with new value of different type!"), function replaceAllUsesWith, file /Users/meister/Development/externals-clasp/llvm36/lib/IR/Value.cpp, line 345. It’s happening when DIBuilder::finalize is being called at the end of a source file compilation. Here’s the most illuminating debugging information I could pull out of a frame: (lldb) frame #6: 0x0000000103a67c...
2015 Jan 19
3
[LLVMdev] Assertion: replaceAllUses of value with new value of different type! being thrown all of a sudden
...g an assertions I added a few weeks after that commit in the Metadata RAUW method. But it is the equivalent assertion in Value::RAUW that you are hitting and that has been there forever. Looking at your exact revision, the assertion seems to trigger while executing: > > DIType(TempEnumTypes).replaceAllUsesWith(Enums); > > in DIBuilder::finalize(). Can you check if TempEnumTypes is null at this point? If that is the issue (which I’m not sure), then you need to call DIBuilder::createCompileUnit() at some point. > > Fred I had a thought, too: are you using two different `LLVMContext`s? That...
2012 Apr 21
4
[LLVMdev] Remove function from module
Thanks, but I replaceAllUsesWith() - works well, but I still get bug in eraseFromParent(): While deleting: i32 (%class.B*, i32)* %_ZN1B1xEi An asserting value handle still pointed to this value! UNREACHABLE executed at /Users/neonomaly/LLVM/LLVM/lib/VMCore/Value.cpp:561! Yours sincerely, Kadysev Mikhail 21.04.2012, в 23:45,...
2019 Jan 15
2
Function - replaceAllUsesWith
...ev at lists.llvm.org>> wrote: Hello LLVM-World, currently I play around with a „llvm::Module” and an external function defined there “puts”. Normally this function gets resolved in the JIT-Process but I wonder about two things: 1. Can I resolve the function already in this step? I used “replaceAllUsesWith” and passed a “llvm::ConstantInt” to the function. But this didn’t worked. I'm not sure if I followed correctly, but you can't replace a function declaration with a constant int. The value for the function will be used (mostly) as an argument to the call instruction, which won't really...
2019 Jan 15
2
Function - replaceAllUsesWith
I could actually track down the cause of the problem: mainModue->getFunction("puts")->replaceAllUsesWith( llvm::ConstantExpr::getPointerCast( llvm::ConstantInt::get(llvm::IntegerType::get(context, 64), 0xF), mainModue->getFunction("puts")->getType() ) ); The problem is the line where I receive the type of the function "puts", it will crash the application - when used as the p...
2019 Jan 15
2
Function - replaceAllUsesWith
...p.northover at gmail.com> Sent: Dienstag, 15. Januar 2019 13:28 To: Gaier, Bjoern <Bjoern.Gaier at horiba.com> Cc: Stefan Gränitz <stefan.graenitz at gmail.com>; Mehdi AMINI <joker.eph at gmail.com>; llvm-dev <llvm-dev at lists.llvm.org> Subject: Re: [llvm-dev] Function - replaceAllUsesWith On Tue, 15 Jan 2019 at 12:25, Gaier, Bjoern via llvm-dev <llvm-dev at lists.llvm.org> wrote: > I wondered if I can do the external symbol resolution without using > the JIT and RuntimeDyld (for now). For me it sounds like something > that could be possible… I'm virtually certai...
2015 Jan 19
2
[LLVMdev] Assertion: replaceAllUses of value with new value of different type! being thrown all of a sudden
...gt; I wonder if someone would know what is going on below. >> >> >> All of a sudden I’m getting this assertion thrown: >> >> Assertion failed: (New->getType() == getType() && "replaceAllUses of value with new value of different type!"), function replaceAllUsesWith, file /Users/meister/Development/externals-clasp/llvm36/lib/IR/Value.cpp, line 345. >> >> It’s happening when DIBuilder::finalize is being called at the end of a source file compilation. >> >> Here’s the most illuminating debugging information I could pull out of a frame:...
2019 Jan 15
2
Function - replaceAllUsesWith
...p.northover at gmail.com> Sent: Dienstag, 15. Januar 2019 15:19 To: Gaier, Bjoern <Bjoern.Gaier at horiba.com> Cc: Stefan Gränitz <stefan.graenitz at gmail.com>; Mehdi AMINI <joker.eph at gmail.com>; llvm-dev <llvm-dev at lists.llvm.org> Subject: Re: [llvm-dev] Function - replaceAllUsesWith On Tue, 15 Jan 2019 at 14:04, Gaier, Bjoern <Bjoern.Gaier at horiba.com> wrote: > Is there a way to copy the value? I want to ensure to use the correct type... I don't think copying is the issue, you're just passing pointers within a single Context around by the looks of it. I h...
2019 Jan 15
2
Function - replaceAllUsesWith
...Kind greetings Björn From: Stefan Gränitz <stefan.graenitz at gmail.com> Sent: Dienstag, 15. Januar 2019 12:42 To: Gaier, Bjoern <Bjoern.Gaier at horiba.com>; Mehdi AMINI <joker.eph at gmail.com> Cc: llvm-dev <llvm-dev at lists.llvm.org> Subject: Re: [llvm-dev] Function - replaceAllUsesWith Hi Björn What does the IR code look like when you dump your module? llvm::outs() << mainModule; I guess for the external function "puts" it will have a declaration like this: declare i32 @puts(i8*) When loading your module in the JIT, RuntimeDyld will resolve it to an actual add...
2014 Aug 09
2
[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?
Why is the first for loop not equivalent to the second? Thanks, Rob =========================== for (GlobalVariable **i = Globals.begin(), **e = Globals.end(); i != e; ++i) { GlobalVariable *GV = *i; Constant *GEP = ConstantExpr::getGetElementPtr(...); GV->replaceAllUsesWith(GEP); } =========================== for (GlobalVariable **i = Globals.begin(), **e = Globals.end(); i != e; ++i) { GlobalVariable *GV = *i; Constant *GEP = ConstantExpr::getGetElementPtr(...); for (Value::use_iterator ui = GV->use_begin(); ui != GV->use_end(); ++ui) { if(User *u = d...
2014 Jun 29
2
[LLVMdev] Wrong behavior modifying and executing llvm::Function with JIT Engine
Hello, The problem I'm having is that I modify a function body by using 'Value::replaceAllUsesWith' and then execute it with the JIT engine several times but I always get the output from the first iteration for all the iterations. This is what I do: I generate the following 2 functions on the fly based on the FunctionType of the declaration below in C code. define i32 @get_int_5(i...
2014 Aug 09
3
[LLVMdev] difference between replaceAllUsesWith and replaceUsesOfWith?
On Sat, Aug 9, 2014 at 6:06 AM, Tim Northover <t.p.northover at gmail.com> wrote: > Hi Rob, > > On 9 August 2014 02:03, Rob Jansen <jansen at cs.umn.edu> wrote: > > Why is the first for loop not equivalent to the second? > > In the second loop, "*ui" is an llvm::Use object. It's owned by a > User, but isn't a subclass of one. To match the
2020 May 15
2
Issues with new Attributor (replaceAllUses fails with type mismatch)
...nstructions *after* we visited all of them. for (auto &CallSitePair : CallSitePairs) { CallBase &OldCB = *CallSitePair.first; CallBase &NewCB = *CallSitePair.second; ModifiedFns.insert(OldCB.getFunction()); CGUpdater.replaceCallSite(OldCB, NewCB); OldCB.replaceAllUsesWith(&NewCB); <---------------------------------------- Failing location OldCB.eraseFromParent(); } Failure symptom: Assertion failed: New->getType() == getType() && "replaceAllUses of value with new value of different type!" Snaps for IR from failing llvm IR an...
2012 Apr 22
2
[LLVMdev] Remove function from module
It is ModulePass with AnalysisUsage of CallGraph Yours sincerely, Kadysev Mikhail 22.04.2012, в 5:20, Nick Lewycky написал(а): > Михаил wrote: >> Thanks, but I replaceAllUsesWith() - works well, but I still get bug in >> eraseFromParent(): >> >> While deleting: i32 (%class.B*, i32)* %_ZN1B1xEi >> An asserting value handle still pointed to this value! >> UNREACHABLE executed at /Users/neonomaly/LLVM/LLVM/lib/VMCore/Value.cpp:561! > > The...
2008 Dec 05
2
[LLVMdev] replacing a global variable by a constant
Hi, I am trying to replace a global variable with a constant. I did manage to do it, but somehow it appears to be fairly bruteforce by just iterating over all functions/bblocks/instructions and filtering for those that load the variable and replacing the instruction with Instruction::replaceAllUsesWith(). The more intuitive way of iterating over the uses of the variable did not work out as I have to replace the whole instruction instead of just the operand (as GlobalVariable::replaceAllUsesWith() does) in order to prevent loading from the memory address of the constant instead of loading the cons...
2013 Oct 24
2
[LLVMdev] LLVM use chains
...m::BasicBlock' *) 0x6c675f7878630046 >> >> My conclusion was that the use chains weren't updated. Is there any >> recommended way of deleting a llvm::Function such that the use chain of the >> globals that it uses to be updated correspondingly? > You probably want replaceAllUsesWith. I am sorry I don't understand. Are you suggesting calling replaceAllUses of the .str1? What I really want to do is to 'erase' the function. By erasing I'd expect the uses of .str1 to 0 (because in the example I have it is used only by f()) and I see they are not. Vassil > &gt...