Instead of DFS numbering basic blocks we now DFS number instructions that avoids the costly operation of which instruction comes first in a basic block.
Patch mostly written by Daniel Berlin.
Paths
| Differential D22777
GVN-hoist: use a DFS numbering of instructions (PR28670) ClosedPublic Authored by sebpop on Jul 25 2016, 1:50 PM.
Details Summary Instead of DFS numbering basic blocks we now DFS number instructions that avoids the costly operation of which instruction comes first in a basic block. Patch mostly written by Daniel Berlin.
Diff Detail Event Timelinesebpop updated this object.
• dberlin edited edge metadata. Comment ActionsGotcha. This revision is now accepted and ready to land.Jul 25 2016, 2:33 PM Closed by commit rL276714: GVN-hoist: use a DFS numbering of instructions (PR28670) (authored by spop). · Explain WhyJul 25 2016, 5:22 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 65413 llvm/lib/Transforms/Scalar/GVNHoist.cpp
llvm/test/Transforms/GVN/hoist.ll
|
Oh, this is the part i forgot :)
Oh well.
One thought:
If we are always inserting at the end of a block (i didn't look), btw, we'd be better off having a per-block numbering.
If we make "I" (here) a member variable called LastDFSNumber, we can then just update the per-block numberings by using ++LastDFSNumber as the number for the hoisted instruction. This avoids walking the instruction stream again on every iteration.