summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Remove loop's bottom label.Dan Gohman2016-10-061-19/+14
| | | | | | | | Per spec changes, loop constructs no longer have a bottom label. https://reviews.llvm.org/D25118 llvm-svn: 283502
* [WebAssembly] Update to more stack-machine-oriented terminology.Dan Gohman2016-10-031-1/+1
| | | | | | | | WebAssembly has officially switched from being an AST to being a stack machine. Update various bits of terminology and README.md entries accordingly. llvm-svn: 283154
* Use StringRef in Pass/PassManager APIs (NFC)Mehdi Amini2016-10-011-3/+1
| | | | llvm-svn: 283004
* [WebAssembly] Unbreak the build.Benjamin Kramer2016-09-051-8/+9
| | | | | | Not sure why ADL isn't working here. llvm-svn: 280656
* WebAssembly: Avoid implicit iterator conversions, NFCDuncan P. N. Exon Smith2016-07-081-4/+4
| | | | | | | | Avoid implicit conversions from MachineInstrBundleIterator to MachineInstr* in the WebAssembly backend by preferring MachineInstr& over MachineInstr*. llvm-svn: 274912
* [WebAssembly] Implement irreducible control flow.Dan Gohman2016-03-091-35/+0
| | | | | | | | This implements a very simple conservative transformation that doesn't require more than linear code size growth. There's room for much more optimization in this space. llvm-svn: 262982
* [WebAssembly] Switch from RPO sorting to topological sorting.Dan Gohman2016-02-161-109/+167
| | | | | | | | | | WebAssembly doesn't require full RPO; topological sorting is sufficient and can preserve more of the MachineBlockPlacement ordering. Unfortunately, this still depends a lot on heuristics, because while we use the MachineBlockPlacement ordering as a guide, we can't use it in places where it isn't topologically ordered. This area will require further attention. llvm-svn: 260978
* [WebAssembly] Fix insertion of a BLOCK in a loop header that also ends a BLOCK.Dan Gohman2016-02-121-1/+3
| | | | llvm-svn: 260737
* [WebAssembly] Refine block placement to insert blocks between trees.Dan Gohman2016-01-301-5/+22
| | | | | | | | | Refine the test for whether an instruction is in an expression tree so that it detects when one tree ends and another begins, so we can place a block at that point, rather than continuing to find the first instruction not in a tree at all. llvm-svn: 259294
* [WebAssemly] Invalidate liveness in CFG stackifierDerek Schuff2016-01-131-0/+3
| | | | | | | WebAssemblyCFGStackify does not track liveness for EXPR_STACK, causing verifier failure if liveness has not already been invalidated. llvm-svn: 257620
* [WebAssembly] Make CFG stackification independent of basic-block labels.Dan Gohman2016-01-121-63/+84
| | | | | | | | | | | | | | | | | | | | | | | This patch changes the way labels are referenced. Instead of referencing the basic-block label name (eg. .LBB0_0), instructions now just have an immediate which indicates the depth in the control-flow stack to find a label to jump to. This makes them much closer to what we expect to have in the binary encoding, and avoids the problem of basic-block label names not being explicit in the binary encoding. Also, it terminates blocks and loops with end_block and end_loop instructions, rather than basic-block label names, for similar reasons. This will also fix problems where two constructs appear to have the same label, because we no longer explicitly use labels, so consumers that need labels will presumably create their own labels, and presumably they won't reuse labels when they do. This patch does make the code a little more awkward to read; as a partial mitigation, this patch also introduces comments showing where the labels are, and comments on each branch showing where it's branching to. llvm-svn: 257505
* [WebAssembly] Minor code cleanups. NFC.Dan Gohman2016-01-081-1/+2
| | | | llvm-svn: 257128
* [WebAssembly] Fix handling of COPY instructions in WebAssemblyRegStackify.Dan Gohman2015-12-251-3/+4
| | | | | | | | | | | | | Move RegStackify after coalescing and teach it to use LiveIntervals instead of depending on SSA form. This avoids a problem where a register in a COPY instruction is stackified and then subsequently coalesced with a register that is not stackified. This also puts it after the scheduler, which allows us to simplify the EXPR_STACK constraint, as we no longer have instructions being reordered after stackification and before coloring. llvm-svn: 256402
* [WebAssembly] Fix the CFG Stackifier to handle unoptimized branchesDan Gohman2015-12-161-2/+14
| | | | | | | If a branch both branches to and falls through to the same block, treat it as an explicit branch. llvm-svn: 255803
* [WebAssembly] Implement a new algorithm for placing BLOCK markersDan Gohman2015-12-141-67/+144
| | | | | | | | | Implement a new BLOCK scope placement algorithm which better handles early-return blocks and early exists from nested scopes. Differential Revision: http://reviews.llvm.org/D15368 llvm-svn: 255564
* [WebAssembly] Fix comments to say "LIFO" instead of "FIFO" when describing a ↵Dan Gohman2015-12-021-1/+1
| | | | | | stack. llvm-svn: 254523
* [WebAssembly] Fix a few minor compiler warnings. NFC.Dan Gohman2015-11-301-7/+7
| | | | llvm-svn: 254311
* [WebAssembly] Minor clang-format and selected clang-tidy cleanups. NFC.Dan Gohman2015-11-291-2/+2
| | | | llvm-svn: 254267
* [WebAssembly] Always print loop end labelsDan Gohman2015-11-231-1/+11
| | | | | | | | | | | | | | | | | WebAssembly is currently using labels to end scopes, so for example a loop scope looks like this: BB0_0: loop BB0_1 ... BB0_1: with BB0_0 being the label of the first block not in the loop. This requires that the label be printed even when it's only reachable via fallthrough. To arrange this, insert a no-op LOOP_END instruction in such cases at the end of the loop. llvm-svn: 253901
* [WebAssembly] Use dominator information to improve BLOCK placementDan Gohman2015-11-231-46/+125
| | | | | | | | | | Always starting blocks at the top of their containing loops works, but creates unnecessarily deep nesting because it makes all blocks in a loop overlap. Refine the BLOCK placement algorithm to start blocks at nearest common dominating points instead, which significantly shrinks them and reduces overlapping. llvm-svn: 253876
* Try to fix build more -- like r252392 but for WebAssembly.Nico Weber2015-11-071-4/+4
| | | | llvm-svn: 252394
* [WebAssembly] Fix CFG stackification of nested loops.Dan Gohman2015-10-021-4/+15
| | | | llvm-svn: 249187
* [WebAssembly] Check in an initial CFG Stackifier passDan Gohman2015-09-161-0/+278
This pass implements a simple algorithm for conversion from CFG to wasm's structured control flow. It doesn't yet handle multiple-entry loops; that will be added in a future patch. It also adds initial support for switch statements. Differential Revision: http://reviews.llvm.org/D12735 llvm-svn: 247818
OpenPOWER on IntegriCloud