search for: phis

Displaying 20 results from an estimated 391 matches for "phis".

Did you mean: his
2017 Sep 25
2
Potential infinite loop in MemorySSAUpdater
I understand that changing the starting element to “InsertedPHIs.being() + StartingPHISize” it will be finite but given that InsrtedPHIs is finite. I have a case where one element(same element is appened to InsertedPHIs) is added to InsertedPHIs every time fixupDefs is invoked. I traced the issue why this was happening. template <class RangeType> MemoryA...
2017 Sep 23
2
Potential infinite loop in MemorySSAUpdater
...reddy via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote: Hi, Can some one explain the intended behaviour of following loop in void MemorySSAUpdater::insertDef(MemoryDef *MD, bool RenameUses) function. while (!FixupList.empty()) { unsigned StartingPHISize = InsertedPHIs.size(); fixupDefs(FixupList); FixupList.clear(); // Put any new phis on the fixup list, and process them FixupList.append(InsertedPHIs.end() - StartingPHISize, InsertedPHIs.end()); } With the latest code on trunk compilation of perlbench SPEC CPU 2017 INT benchm...
2017 Sep 23
0
Potential infinite loop in MemorySSAUpdater
...vm-dev at lists.llvm.org> wrote: > >> Hi, >> >> Can some one explain the intended behaviour of following loop in void >> MemorySSAUpdater::insertDef(MemoryDef *MD, bool RenameUses) function. >> >> while (!FixupList.empty()) { >> unsigned StartingPHISize = InsertedPHIs.size(); >> fixupDefs(FixupList); >> FixupList.clear(); >> // Put any new phis on the fixup list, and process them >> FixupList.append(InsertedPHIs.end() - StartingPHISize, >> InsertedPHIs.end()); >> } >> >> With the...
2017 Sep 25
0
Potential infinite loop in MemorySSAUpdater
We should only add phis that were newly inserted, not ones that were already found. There are two cases we will hvae inserted phis: Part of the recursive call, or right in this function. The easiest way to differentiate new phis from old ones is whether they have 0 operands. I expect the attached will fix it. If not, pl...
2020 Mar 17
2
valid BasicAA behavior?
My understanding is that alias analysis returns results in the function scope, not in loop scope. Since both the phis access both global arrays, that should results in BasicAA conservatively returning MayAlias. I debugged this a little bit and narrowed it down to the section of the code in BasicAAResult::aliasPHI() which has this comment- // Analyse the PHIs' inputs under the assumption that the PHIs ar...
2020 Mar 17
3
valid BasicAA behavior?
...at lists.llvm.org<mailto:llvm-dev at lists.llvm.org> <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> Subject: Re: [llvm-dev] valid BasicAA behavior? My understanding is that alias analysis returns results in the function scope, not in loop scope. Since both the phis access both global arrays, that should results in BasicAA conservatively returning MayAlias. I debugged this a little bit and narrowed it down to the section of the code in BasicAAResult::aliasPHI() which has this comment- // Analyse the PHIs' inputs under the assumption that the PHIs...
2020 Feb 03
2
Eliminate some two entry PHI nodes - SimplifyCFG
...oks to simplify all 2 entry phi nodes in a block, if it can't do them all then it won't do any and returns. There is a lot of code that is directly in this function geared toward this requirement. Is it possible currently to get this function (or pass) to simply fold "some" of the phis (without having to fold them all?). I understand that "Simplify"CFG isn't really meant for this type of thing but there is a lot of code that is re-usable to do this with some refactoring of this function and potentially some addition of target specifics. For some phis, it's bene...
2009 Jan 28
5
[LLVMdev] Copy Instructions?
...t;> mem2reg appears to be working as intended; the correct completion is > >> in fact as follows: > >> // x = phi(x.0, expr) > >> // y = phi(y.0, x) > > > > Yes, that's what mem2reg ends up with. > > Why is this a problem? All phis execute "atomically". What problem > are you seeing in practice? I'm getting incorrect answers. How can a set of phis with a dependence execute simultaenously? There is only one definition of x and it has to happen before the use of x in the phi defining y, doesn't it? Owen...
2011 Feb 01
0
[LLVMdev] Loop simplification
...you want out-of-box, but it should not be hard to write. llvm::FoldSingleEntryPHINodes is an example of phi node replacement. But in this case, you'll need to do one in-place operand replacement for each successor phi use and call PhiNode::addIncoming for the rest. Note that multiple successor phis may use the same predecessor phi, so you should be careful of mutating the phis while iterating their uses. If you cover the trivial case first with llvm::MergeBlockIntoPredecessor, then the predecessor phis should have no uses other than successor phis. That would violate strict SSA (the CFG edge...
2020 Feb 05
2
Eliminate some two entry PHI nodes - SimplifyCFG
...2 entry phi nodes > in a block, if it can't do them all then it won't do any and returns. There > is a lot of code that is directly in this function geared toward this > requirement. Is it possible currently to get this function (or pass) to > simply fold "some" of the phis (without having to fold them all?). I > understand that "Simplify"CFG isn't really meant for this type of thing but > there is a lot of code that is re-usable to do this with some refactoring > of this function and potentially some addition of target specifics. > > >...
2011 Feb 01
3
[LLVMdev] Loop simplification
...you want out-of-box, but it should not be hard to write. llvm::FoldSingleEntryPHINodes is an example of phi node replacement. But in this case, you'll need to do one in-place operand replacement for each successor phi use and call PhiNode::addIncoming for the rest. Note that multiple successor phis may use the same predecessor phi, so you should be careful of mutating the phis while iterating their uses. If you cover the trivial case first with llvm::MergeBlockIntoPredecessor, then the predecessor phis should have no uses other than successor phis. That would violate strict SSA (the CFG edge...
2019 Jul 16
2
MachinePipeliner refactoring
...ndle (at least in the current code). I’ll take a deeper look at your patch. The abstractions that you mention, Stage and Block, are good ones. I think you’ll need to account for the cycle, or position within a Stage as well. It is a complex problem with a lot different edge cases when dealing with Phis, though I think they can be dealt with much better than the existing code. Generating code for the 3 main parts, the prolog, kernel, and epilog, can be challenging because each has a unique difference that made is hard to generalize the code. For example, the prologs will not have an Phis, but th...
2011 Feb 01
5
[LLVMdev] Loop simplification
I have a (non-entry) basic block that contains only PHI nodes and an unconditional branch (that does not branch to itself). Is it always possible to merge this block with it's successor and produce a semantically equivalent program? I'm trying to undo some of the loop optimizations that LLVM has applied to my program to reduce a pair of nested loops to a single loop.
2011 Aug 31
4
[LLVMdev] Getting rid of phi instructions?
On 30.8.2011, at 19.19, Eli Friedman wrote: > reg2mem won't do quite this transformation... not sure exactly what you need. I need to get rid of phis. This code is compiled from C++ and for some functions there are no phis, but multiple call instructions. I am targeting hardware in the end, and the next tool reading the IR does not like phis when it's generating VHDL. My questions may be somewhat silly from the viewpoint of software compilat...
2020 Mar 17
2
valid BasicAA behavior?
..., double *B); void swap_deps() { double *A = Ag; double *B = Bg; for (int i = 0; i < 97; ++i) { for (int j = 0; j < N; ++j) { B[j] = A[j] + 1; } double *tmp = A; A = B; B = tmp; } consume(A, B); } BasicAA is returning 'NoAlias' when queried for phis created in the i-loop for A and B. I was expecting it to return MayAlias since A and B are being swapped in the outer loop and so they access same locations in alternate iterations of the i-loop. Is BasicAA returning the correct result in this case? Thanks, Pankaj -------------- next part -------...
2012 Mar 08
2
[LLVMdev] Updating value from PHI
Here is the code snippet that I am using to create the PHIs in the loop according to the PHIs in the new preheader. At this point I have already redirected the loop backedge and removed the preheader from the loop. for (BasicBlock::iterator II = loopHeaderBB->begin(); (PN=dyn_cast<PHINode>(II)); ++II) { // remove loop ba...
2011 Feb 01
0
[LLVMdev] Loop simplification
Here's what I've got so far - it seems to work, aside from the fact that DeleteDeadPHIs is not removing at least one dead PHI in my test program. --------------------- static bool mergeBlockIntoSuccessor(BasicBlock *pred, BasicBlock *succ) { if (succ == pred) return false; if (pred->getFirstNonPHI() != pred->getTerminator()) return false; //...
2012 Mar 07
4
[LLVMdev] Updating value from PHI
I am splitting a one BB loop into two BB. Basically, the one loop BB has 3 incoming values, one form back edge two from other edges. I want to extract the PHIs from the other two edges out into it's own BB and delete that from the loop, then redirect the backedge to the loopbody (non extracted portion) and create a new PHI coming from the extracted BB and the backedge. I can do this; however, the PHIs following in all the other BBs are not getting up...
2009 Jan 28
4
[LLVMdev] Copy Instructions?
...it, > mem2reg appears to be working as intended; the correct completion is > in fact as follows: > // x = phi(x.0, expr) > // y = phi(y.0, x) Yes, that's what mem2reg ends up with. > > In this particular example another solution would be to reorder the phis > > but I don't think that will work in the general case. > > PHI nodes don't have an ordering, at least conceptually; they're not > real instructions. They don't have an ordering? So what does your above code mean? I would have expected it to mean that y is eithe...
2008 Aug 27
2
[LLVMdev] Mandatory duplicated incoming nodes on phis
Hi, I noticed that if you create a switch with multiple cases going to the same destination, then if that destination contains phis you need to add the incoming value an equivalent number of times. The attached code seems wrong, but it compiles as correct, and removing the duplicated incoming node causes an error. Is this expected? Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- define internal i...