search for: movebefore

Displaying 20 results from an estimated 22 matches for "movebefore".

2010 Nov 29
1
[LLVMdev] Segmentation fault on Instruction.moveBefore()
Hi, I'm getting a segmentation fault trying to write a small(incomplete) LICM pass whenever i try to do I->moveBefore(pre->getTerminator()); (wherer I is Instruction*, Pre is BasicBlock*) Is there any prerequisites for executing this function that i am not doing? Thanks in advance. sreeraj -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-...
2010 Nov 17
2
[LLVMdev] L->isLoopInvariant giving wrong results?
...is Lattner <clattner at apple.com> wrote: > > On Nov 17, 2010, at 1:38 PM, Sreeraj a wrote: > > > Thanks Chris, > > > > I was able to weed out loop invariant arithmetic instructions using > isLoopInvariant function. > > when i try to do an instruction->moveBefore(bb->getTerminator()) i'm > getting a seg fault. > > any obvious reasons that i'm missing out on? > > No idea, sorry. > > -Chris > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/atta...
2010 Jun 13
2
[LLVMdev] Block management
...later (that is I cannot create the function at the beginning stage become some info are not available yet). I tried to create a block without any "parent" (BasicBlock::Create(getGlobalContext(), "init"), fill it, but how to link it with the created function? (i read about "moveBefore" and "moveAfter" but these methods are not usable in this context... Thanks Stéphane Letz
2010 Nov 17
1
[LLVMdev] L->isLoopInvariant giving wrong results?
...xecute()){ if(isLoopInvariantInst(*hijk)){ errs() << " " << *hijk << " is loop invariant\n"; errs() << " hoisting to " << pre->getName() << "\n"; // This is where all the trouble happens. hijk->moveBefore(pre->getTerminator()); changed=true; } } } return changed; } bool MyLoopPass::isLoopInvariantInst(Instruction &I) { // The instruction is loop invariant if all of its operands are loop-invariant for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) if (!curLoop-&gt...
2010 Nov 17
2
[LLVMdev] L->isLoopInvariant giving wrong results?
Thanks Chris, I was able to weed out loop invariant arithmetic instructions using isLoopInvariant function. when i try to do an instruction->moveBefore(bb->getTerminator()) i'm getting a seg fault. any obvious reasons that i'm missing out on? Thanks in advance On Wed, Nov 17, 2010 at 10:41 PM, Chris Lattner <clattner at apple.com> wrote: > > On Nov 17, 2010, at 2:20 AM, Sreeraj a wrote: > > > Hi, > > I'...
2010 Nov 17
0
[LLVMdev] L->isLoopInvariant giving wrong results?
...> wrote: > >> >> On Nov 17, 2010, at 1:38 PM, Sreeraj a wrote: >> >> > Thanks Chris, >> > >> > I was able to weed out loop invariant arithmetic instructions using >> isLoopInvariant function. >> > when i try to do an instruction->moveBefore(bb->getTerminator()) i'm >> getting a seg fault. >> > any obvious reasons that i'm missing out on? >> >> No idea, sorry. >> >> -Chris >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://l...
2012 Feb 03
1
[LLVMdev] Issues with the llvm.stackrestore intrinsic - now LoopRotation handling of alloca
...loop doesn't write). >      if (L->hasLoopInvariantOperands(Inst) && >          !Inst->mayReadFromMemory() && !Inst->mayWriteToMemory() && >          !isa<TerminatorInst>(Inst) && !isa<DbgInfoIntrinsic>(Inst)) { >        Inst->moveBefore(LoopEntryBranch); >        continue; >      } > > The above code happily moves an alloca instruction out of the loop, to > the new loop header. Shouldn't we also check on > >   !isa<AllocaInst>(Inst) > > before allowing to move it? > > > The code that b...
2010 Jun 13
0
[LLVMdev] Block management
...later (that is I cannot create the function at the beginning stage become some info are not available yet). I tried to create a block without any "parent" (BasicBlock::Create(getGlobalContext(), "init"), fill it, but how to link it with the created function? (i read about "moveBefore" and "moveAfter" but these methods are not usable in this context... You can use Function::getBasicBlockList(). That list supports fully general list operations like "insert", so you can just plop it in wherever you'd like it. -Chris
2010 Jun 14
1
[LLVMdev] Block management
...later (that is I cannot create the function at the beginning stage become some info are not available yet). I tried to create a block without any "parent" (BasicBlock::Create(getGlobalContext(), "init"), fill it, but how to link it with the created function? (i read about "moveBefore" and "moveAfter" but these methods are not usable in this context... > > You can use Function::getBasicBlockList(). That list supports fully general list operations like "insert", so you can just plop it in wherever you'd like it. methods like the basic block co...
2010 Nov 17
0
[LLVMdev] L->isLoopInvariant giving wrong results?
On Nov 17, 2010, at 1:38 PM, Sreeraj a wrote: > Thanks Chris, > > I was able to weed out loop invariant arithmetic instructions using isLoopInvariant function. > when i try to do an instruction->moveBefore(bb->getTerminator()) i'm getting a seg fault. > any obvious reasons that i'm missing out on? No idea, sorry. -Chris
2018 Aug 27
3
Replacing a function from one module into another one
Hello LLVM Developers, I'm trying to replace a function defined in one module into another module (different files). The first issue I ran into was that llvm::Function does not have a method "moveBefore" or "moveAfter" as the llvm::BasicBlock or llvm::Instruction do, so I figured I would just move the BasicBlocks of the replacing function into the function that was being replaced, and then eliminate the original BasicBlocks. So far I had only one issue while eliminating the original...
2012 Feb 03
0
[LLVMdev] Issues with the llvm.stackrestore intrinsic - now LoopRotation handling of alloca
...proving that the loop doesn't write). if (L->hasLoopInvariantOperands(Inst) && !Inst->mayReadFromMemory() && !Inst->mayWriteToMemory() && !isa<TerminatorInst>(Inst) && !isa<DbgInfoIntrinsic>(Inst)) { Inst->moveBefore(LoopEntryBranch); continue; } The above code happily moves an alloca instruction out of the loop, to the new loop header. Shouldn't we also check on !isa<AllocaInst>(Inst) before allowing to move it? The code that breaks because of the moved alloca looks like start:...
2012 Feb 01
3
[LLVMdev] Issues with the llvm.stackrestore intrinsic
Hi, I have two problems regarding the llvm.stackrestore intrinsic. I'm running on 3.0, but a quick test on trunk also showed the same behavior. First problem: --------------- I have code like: tmp1 = call llvm.stacksave() tmp2 = alloca [do some stuff with tmp2] call llvm.stackrestore(tmp1) [some other stuff] tmp3 = call llvm.stacksave() tmp4 = alloca [do some stuff
2018 Sep 02
2
Replacing a function from one module into another one
...7/2018 10:37 AM, Daniel Moya via llvm-dev wrote: > > Hello LLVM Developers, > > > > I'm trying to replace a function defined in one module into another > > module (different files). The first issue I ran into was that > > llvm::Function does not have a method "moveBefore" or "moveAfter" as > > the llvm::BasicBlock or llvm::Instruction do, so I figured I would > > just move the BasicBlocks of the replacing function into the function > > that was being replaced, and then eliminate the original BasicBlocks. > > Cross-module opera...
2018 Sep 02
2
Replacing a function from one module into another one
...v wrote: >>> > Hello LLVM Developers, >>> > >>> > I'm trying to replace a function defined in one module into another >>> > module (different files). The first issue I ran into was that >>> > llvm::Function does not have a method "moveBefore" or "moveAfter" as >>> > the llvm::BasicBlock or llvm::Instruction do, so I figured I would >>> > just move the BasicBlocks of the replacing function into the function >>> > that was being replaced, and then eliminate the original BasicBlocks. >...
2010 Nov 17
0
[LLVMdev] L->isLoopInvariant giving wrong results?
On Nov 17, 2010, at 2:20 AM, Sreeraj a wrote: > Hi, > I'm trying to write a simple pass to print out Loop invariant instructions, using the > Loop::isLoopInvariant(Instruction *I) > function. it is giving me false value on instructions which should be loop invariant. > > the code i am using is: The isLoopInvariant method just works for scalar operations like
2010 Nov 17
2
[LLVMdev] L->isLoopInvariant giving wrong results?
Hi, I'm trying to write a simple pass to print out Loop invariant instructions, using the Loop::isLoopInvariant(Instruction *I) function. it is giving me false value on instructions which should be loop invariant. the code i am using is: bool MyLoopPass::runOnLoop(Loop * L, LPPassManager &lpm){ BasicBlock* lat=L->getLoopLatch(); for (BasicBlock::iterator i = lat->begin(), e =
2018 Sep 03
2
Replacing a function from one module into another one
...LLVM Developers, >>>>> > >>>>> > I'm trying to replace a function defined in one module into another >>>>> > module (different files). The first issue I ran into was that >>>>> > llvm::Function does not have a method "moveBefore" or "moveAfter" as >>>>> > the llvm::BasicBlock or llvm::Instruction do, so I figured I would >>>>> > just move the BasicBlocks of the replacing function into the >>>>> function >>>>> > that was being replaced, and...
2018 Sep 04
2
Replacing a function from one module into another one
...gt;>>>> > I'm trying to replace a function defined in one module into >>>>>>> another >>>>>>> > module (different files). The first issue I ran into was that >>>>>>> > llvm::Function does not have a method "moveBefore" or "moveAfter" >>>>>>> as >>>>>>> > the llvm::BasicBlock or llvm::Instruction do, so I figured I would >>>>>>> > just move the BasicBlocks of the replacing function into the >>>>>>> function &g...
2010 Feb 08
2
[LLVMdev] Test approach to handling clobbering llvm.eh.selector return
...he new llvm.eh.selector call. The code, at this point, could remove the exception argument from the old llvm.eh.selector call, but this treatment would not follow the replace semantics of pre-existing code. 2) The llvm.eh.selector is instead moved to the correct position (using llvm.Instruction.moveBefore(...)), with any necessary exception argument change. This version required a change in the control flow and is therefore larger addition to DwarfEHPrepare. Problems: Although the patch deals with the llvm.eh.selector's exception argument, it does not know how to deal with its other argument...