summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Make several CHECK lines less fragile using regexes and CHECK-DAG.Dan Gohman2016-05-192-31/+31
| | | | llvm-svn: 270011
* [WebAssembly] Don't expand divisions by constants.Dan Gohman2016-05-181-0/+62
| | | | | | | Don't expand divisions by constants if it would require multiple instructions. The current assumption is that engines will perform the desired optimizations. llvm-svn: 269930
* [WebAssembly] Rename $discard to $drop in the assembly output.Dan Gohman2016-05-1717-122/+122
| | | | llvm-svn: 269862
* [WebAssembly] Model the stack evaluation order more precisely.Dan Gohman2016-05-172-12/+33
| | | | | | | | | | | We currently don't represent get_local and set_local explicitly; they are just implied by virtual register use and def. This avoids a lot of clutter, but it does complicate stackifying: get_locals read their operands at their position in the stack evaluation order, rather than at their parent instruction. This patch adds code to walk the stack to determine the precise ordering, when needed. llvm-svn: 269854
* [WebAssembly] Don't stackify calls past stack pointer modifications.Dan Gohman2016-05-171-1/+15
| | | | llvm-svn: 269843
* [WebAssembly] Stackify induction variable increment instructions.Dan Gohman2016-05-172-14/+44
| | | | | | | This handles instructions where the defined register is also used, as in "x = x + 1". llvm-svn: 269830
* [WebAssembly] Improve the precision of memory and side effect dependence ↵Dan Gohman2016-05-171-2/+34
| | | | | | | | | | tracking. MachineInstr::isSafeToMove is more conservative than is needed here; use a more explicit check, and incorporate knowledge of some WebAssembly-specific opcodes. llvm-svn: 269736
* [WebAssembly] Mark COPY_LOCAL and TEE_LOCAL instructions has having no side ↵Dan Gohman2016-05-161-3/+5
| | | | | | effects. llvm-svn: 269683
* [WebAssembly] Use eqz to negate a branch conditions.Dan Gohman2016-05-161-2/+1
| | | | llvm-svn: 269681
* [WebAssembly] Fix legalization of i128 shifts.Dan Gohman2016-05-141-0/+280
| | | | | | | | compiler-rt/libgcc shift routines expect the shift count to be an i32, so use i32 as the shift count for shifts that are legalized to libcalls. This also reverts r268991, now that the signatures are correct. llvm-svn: 269531
* [WebAssembly] Fast-isel support for calls, arguments, and selects.Dan Gohman2016-05-122-1/+2
| | | | llvm-svn: 269273
* [WebAssembl] Implement enough of fast-isel to run the comparison tests.Dan Gohman2016-05-112-0/+2
| | | | llvm-svn: 269203
* [WebAssembly] Preliminary fast-isel support.Dan Gohman2016-05-108-5/+38
| | | | llvm-svn: 269083
* [WebAssembly] Move register stackification and coloring to a late phase.Dan Gohman2016-05-107-151/+173
| | | | | | | | | | | | | | | | | | | Move the register stackification and coloring passes to run very late, after PEI, tail duplication, and most other passes. This means that all code emitted and expanded by those passes is now exposed to these passes. This also eliminates the need for prologue/epilogue code to be manually stackified, which significantly simplifies the code. This does require running LiveIntervals a second time. It's useful to think of these late passes not as late optimization passes, but as a domain-specific compression algorithm based on knowledge of liveness information. It's used to compress the code after all conventional optimizations are complete, which is why it uses LiveIntervals at a phase when actual optimization passes don't typically need it. Differential Revision: http://reviews.llvm.org/D20075 llvm-svn: 269012
* [WebAssembly] Don't emit epilogue code in the middle of stackified code.Dan Gohman2016-05-051-0/+12
| | | | llvm-svn: 268679
* [WebAssembly] Rename memory_size intrinsic to current_memoryDerek Schuff2016-05-022-10/+10
| | | | | | This follows the recent renaming in the wasm spec. llvm-svn: 268255
* [WebAssembly] Account for implicit operands when computing operand indices.Dan Gohman2016-04-261-1/+7
| | | | llvm-svn: 267511
* [WebAssembly] Limit alignment hints to natural alignment.Dan Gohman2016-04-213-17/+21
| | | | | | This follows the current binary format rules. llvm-svn: 267082
* Let the DISubprogram in this test point to the right compile unit.Adrian Prantl2016-04-151-1/+1
| | | | llvm-svn: 266468
* Update testcase to new debug metadata format.Adrian Prantl2016-04-151-3/+2
| | | | llvm-svn: 266467
* [WebAssembly] Fix debug info in reg-stackify.ll testDerek Schuff2016-04-121-18/+23
| | | | | | It lacked a CU and thus became invalid with r266102 llvm-svn: 266114
* WebAssembly: fix cfg-stackify testJF Bastien2016-04-051-10/+10
| | | | | | It was broken by reshuffling induced by r265397 'Don't delete empty preheaders in CodeGenPrepare if it would create a critical edge'. llvm-svn: 265415
* [WebAssembly] Implement the rotate instructions.Dan Gohman2016-03-222-0/+108
| | | | llvm-svn: 264076
* [WebAssembly] Implement the eqz instructions.Dan Gohman2016-03-212-0/+22
| | | | llvm-svn: 263976
* [WebAssembly] Stackify code emitted by eliminateFrameIndex and SP writebackDerek Schuff2016-03-173-41/+41
| | | | | | | | | | | | | | | | | Summary: MRI::eliminateFrameIndex can emit several instructions to do address calculations; these can usually be stackified. Because instructions with FI operands can have subsequent operands which may be expression trees, find the top of the leftmost tree and insert the code before it, to keep the LIFO property. Also use stackified registers when writing back the SP value to memory in the epilog; it's unnecessary because SP will not be used after the epilog, and it results in better code. Differential Revision: http://reviews.llvm.org/D18234 llvm-svn: 263725
* [WebAssembly] Implement irreducible control flow.Dan Gohman2016-03-091-0/+88
| | | | | | | | 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] Update for spec change from tableswitch to br_table.Dan Gohman2016-03-082-4/+4
| | | | | | | Also note that the operand order changed; the default label is now listed after the regular labels. llvm-svn: 262903
* WebAssembly: fix testJF Bastien2016-02-281-10/+10
| | | | | | Operand order seems to have changed, the new one is nicer. llvm-svn: 262180
* Revert "[WebAssembly] Stackify code emitted by eliminateFrameIndex"Derek Schuff2016-02-233-21/+21
| | | | | | This reverts r261685 due to wasm test breakage. llvm-svn: 261702
* [WebAssembly] Stackify code emitted by eliminateFrameIndexDerek Schuff2016-02-233-21/+21
| | | | llvm-svn: 261685
* [WebAssembly] Implement red zone for user stackDerek Schuff2016-02-231-21/+37
| | | | | | | | | | | Implements a mostly-conventional redzone for the userspace stack. Because we have unsigned load/store offsets we continue to use a local SP subtracted from the incoming SP but do not write it back to memory. Differential Revision: http://reviews.llvm.org/D17525 llvm-svn: 261662
* [WebAssembly] Fix writeback of stack pointer with dynamic allocaDerek Schuff2016-02-221-5/+12
| | | | | | | | | | | Previously the stack pointer was only written back to memory in the prolog. But this is wrong for dynamic allocas, for which target-independent codegen handles SP updates after the prolog (and possibly even in another BB). Instead update the SP global in ADJCALLSTACKDOWN which is generated after the SP update sequence. This will have further refinements when we add red zone support. llvm-svn: 261579
* [WebAssembly] Teach address folding to fold bitwise-or nodes.Dan Gohman2016-02-221-0/+21
| | | | | | | | | LLVM converts adds into ors when it can prove that the operands don't share any non-zero bits. Teach address folding to recognize or instructions with constant operands with this property that can be folded into addresses as if they were adds. llvm-svn: 261562
* [WebAssembly] Properly ignore llvm.dbg.value instructions.Dan Gohman2016-02-221-0/+18
| | | | llvm-svn: 261538
* [WebAssembly] Support physical registers in the rewrite-to-discard optimization.Dan Gohman2016-02-211-10/+10
| | | | llvm-svn: 261465
* [WebAssembly] Handle CopyToReg nodes with flag results in LowerCopyToReg.Dan Gohman2016-02-201-0/+12
| | | | llvm-svn: 261457
* [WebAssembly] Write stack pointer back to memory when FP is usedDerek Schuff2016-02-201-1/+4
| | | | | | | | The stack pointer is bumped when there is a frame pointer or when there are static-size objects, but was only getting written back when there were static-size objects. llvm-svn: 261453
* [WebAssembly] Stackify function prologs and epilogsDerek Schuff2016-02-203-87/+90
| | | | | | | | The instructions are the same, but fewer locals are used. Differential Revision: http://reviews.llvm.org/D17428 llvm-svn: 261452
* [WebAssembly] Don't use setRequiresStructuredCFG(true).Dan Gohman2016-02-181-37/+28
| | | | | | | | | | | | While we still do want reducible control flow, the RequiresStructuredCFG flag imposes more strict structure constraints than WebAssembly wants. Unsetting this flag enables critical edge splitting and tail merging. Also, disable TailDuplication explicitly, as it doesn't support virtual registers, and was previously only disabled by the RequiresStructuredCFG flag. llvm-svn: 261190
* [WebAssembly] Call memcpy for large byval copies.Dan Gohman2016-02-171-17/+14
| | | | | | | | | | This fixes very slow compilation on test/CodeGen/Generic/2010-11-04-BigByval.ll . Note that MaxStoresPerMemcpy and friends are not yet carefully tuned so the cutoff point is currently somewhat arbitrary. However, it's important that there be a cutoff point so that we don't emit unbounded quantities of loads and stores. llvm-svn: 261050
* [WebAssembly] Implement __builtin_frame_address.Dan Gohman2016-02-161-0/+31
| | | | | | Differential Revision: http://reviews.llvm.org/D17307 llvm-svn: 261032
* [WebAssemly] Don't move calls or stores past intervening loadsDerek Schuff2016-02-161-0/+39
| | | | | | | | | | The register stackifier currently checks for intervening stores (and loads that may alias them) but doesn't account for the fact that the instruction being moved may affect intervening loads. Differential Revision: http://reviews.llvm.org/D17298 llvm-svn: 261014
* [WebAssembly] Insert COPY_LOCAL between CopyToReg and FrameIndex DAG nodesDerek Schuff2016-02-161-0/+21
| | | | | | | | | | | | | | CopyToReg nodes don't support FrameIndex operands. Other targets select the FI to some LEA-like instruction, but since we don't have that, we need to insert some kind of instruction that can take an FI operand and produces a value usable by CopyToReg (i.e. in a vreg). So insert a dummy copy_local between Op and its FI operand. This results in a redundant copy which we should optimize away later (maybe in the post-FI-lowering peephole pass). Differential Revision: http://reviews.llvm.org/D17213 llvm-svn: 260987
* [WebAssembly] Switch from RPO sorting to topological sorting.Dan Gohman2016-02-161-87/+133
| | | | | | | | | | 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] Create new registers instead of reusing old ones in RegStackify.Dan Gohman2016-02-162-30/+73
| | | | | | | | This avoids some complications updating LiveIntervals to be aware of the new register lifetimes, because we can just compute new intervals from scratch rather than describe how the old ones have been changed. llvm-svn: 260971
* [WebAssembly] Implement support for custom NaN bit patterns.Dan Gohman2016-02-161-0/+35
| | | | llvm-svn: 260968
* [WebAssembly] Fix byval for empty types.Dan Gohman2016-02-121-0/+19
| | | | llvm-svn: 260740
* [WebAssembly] Fix insertion of a BLOCK in a loop header that also ends a BLOCK.Dan Gohman2016-02-121-0/+62
| | | | llvm-svn: 260737
* [WebAssembly] Switch varags calling convention to use a registerDerek Schuff2016-02-101-8/+30
| | | | | | | | | | | | Instead of passing varargs directly on the user stack, allocate a buffer in the caller's stack frame and pass a pointer to it. This simplifies the C ABI (e.g. non-C callers of C functions do not need to use C's user stack if they have their own mechanism) and allows further optimizations in the future (e.g. fewer functions may need to use the stack). Differential Revision: http://reviews.llvm.org/D17048 llvm-svn: 260421
* [WebAssembly] Update the br_if instructions' operand orders to match the spec.Dan Gohman2016-02-082-101/+101
| | | | llvm-svn: 260152
OpenPOWER on IntegriCloud