summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Fix a compiler warning. NFC.Dan Gohman2016-12-021-1/+1
| | | | | | | Fix a warning about a comparison between signed and unsigned integer expressions. llvm-svn: 288532
* IR: Change the gep_type_iterator API to avoid always exposing the "current" ↵Peter Collingbourne2016-12-021-1/+1
| | | | | | | | | | | | | type. Instead, expose whether the current type is an array or a struct, if an array what the upper bound is, and if a struct the struct type itself. This is in preparation for a later change which will make PointerType derive from Type rather than SequentialType. Differential Revision: https://reviews.llvm.org/D26594 llvm-svn: 288458
* [WebAssembly] Emit .import_global assembler directivesDerek Schuff2016-12-013-0/+16
| | | | | | | | | | | | Support a new assembler directive, .import_global, to declare imported global variables (i.e. those with external linkage and no initializer). The linker turns these into wasm imports. Patch by Jacob Gravelle Differential Revision: https://reviews.llvm.org/D26875 llvm-svn: 288296
* [CMake] NFC. Updating CMake dependency specificationsChris Bieneman2016-11-171-2/+3
| | | | | | This patch updates a bunch of places where add_dependencies was being explicitly called to add dependencies on intrinsics_gen to instead use the DEPENDS named parameter. This cleanup is needed for a patch I'm working on to add a dependency debugging mode to the build system. llvm-svn: 287206
* [WebAssembly] Convert stackified IMPLICIT_DEF into constant 0.Dan Gohman2016-11-081-0/+37
| | | | | | | | | | Since IMPLIFIT_DEF instructions are omitted in the output, when the output of an IMPLICIT_DEF instruction is stackified, the resulting register lacks an explicit push, leading to a push/pop mismatch. Fix this by converting such IMPLICIT_DEFs into CONST_I32 0 instructions so that they have explicit pushes. llvm-svn: 286274
* [WebAssembly] Emit a BasePointer when we have overly-aligned stack objectsDerek Schuff2016-11-073-10/+64
| | | | | | | | | | | | Because we shift the stack pointer by an unknown amount, we need an additional pointer. In the case where we have variable-size objects as well, we can't reuse the frame pointer, thus three pointers. Patch by Jacob Gravelle Differential Revision: https://reviews.llvm.org/D26263 llvm-svn: 286160
* [WebAssembly] Update the README.txt.Dan Gohman2016-10-261-9/+17
| | | | | | | | Update the README.txt with newer information, add a link to the Emscripten page explaining the current easiest way to use the LLVM wasm backend, and mention that other ways of using the LLVM wasm backend are in development. llvm-svn: 285215
* [WebAssembly] Add immediate fields to call_indirect and memory operators.Dan Gohman2016-10-254-18/+26
| | | | | | | call_indirect, grow_memory, and current_memory now have immediate operands in the 0xd binary encoding. llvm-svn: 285085
* Fix an unused warning in WebAssemblyInstPrinter with NDEBUG.Benjamin Kramer2016-10-251-0/+1
| | | | | | | | Patch by Sam McCall! Differential Revision: https://reviews.llvm.org/D25934 llvm-svn: 285055
* [WebAssembly] Reorder load/store operands to match binary encoding.Dan Gohman2016-10-254-294/+296
| | | | | | | The p2align operand of a load/store is encoded before the offset operand; reorder the MachineInstr operands accordingly. llvm-svn: 285044
* [WebAssembly] Implement more WebAssembly binary encoding.Dan Gohman2016-10-2416-131/+126
| | | | | | | | | | | | This changes locals from being declared by the emitLocal hook in WebAssemblyTargetStreamer, rather than with an instruction. After exploring the infastructure in LLVM more, this seems to make more sense since declaring locals doesn't use an encoded opcode. This also adds more 0xd opcodes, type encodings, and miscellaneous binary encoding bits. llvm-svn: 285040
* [WebAssembly] Fix a broken URL.Dan Gohman2016-10-241-1/+1
| | | | llvm-svn: 285017
* [WebAssembly] Define the `end` opcode value.Dan Gohman2016-10-241-2/+4
| | | | | | | CFGStackify differentiates between END_LOOP and END_BLOCK, but wasm itself doesn't. For now, just use the same opcode for both. llvm-svn: 285016
* [WebAssembly] Update opcode values according to recent spec changes.Dan Gohman2016-10-246-112/+112
| | | | | | This corresponds to the "0xd" opcode renumbering. llvm-svn: 285014
* [WebAssembly] Add an option to make get_local/set_local explicit.Dan Gohman2016-10-2422-177/+632
| | | | | | | | | | This patch adds a pass, controlled by an option and off by default for now, for making implicit get_local/set_local explicit. This simplifies emitting wasm with MC. Differential Revision: https://reviews.llvm.org/D25836 llvm-svn: 285009
* [WebAssembly] Fix for 0xc call_indirect changesDerek Schuff2016-10-216-20/+159
| | | | | | | | | | | | | | | | | Summary: Need to reorder the operands to have the callee as the last argument. Adds a pseudo-instruction, and a pass to lower it into a real call_indirect. This is the first of two options for how to fix the problem. Reviewers: dschuff, sunfish Subscribers: jfb, beanz, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D25708 llvm-svn: 284840
* Do a sweep over move ctors and remove those that are identical to the default.Benjamin Kramer2016-10-201-7/+0
| | | | | | | | | | All of these existed because MSVC 2013 was unable to synthesize default move ctors. We recently dropped support for it so all that error-prone boilerplate can go. No functionality change intended. llvm-svn: 284721
* Fix WebAssembly build after r283702.Daniel Jasper2016-10-101-2/+8
| | | | llvm-svn: 283723
* Move the global variables representing each Target behind accessor functionMehdi Amini2016-10-096-13/+16
| | | | | | | | This avoids "static initialization order fiasco" Differential Revision: https://reviews.llvm.org/D25412 llvm-svn: 283702
* [WebAssemby] Implement block signatures.Dan Gohman2016-10-0612-61/+199
| | | | | | | | | Per spec changes, this implements block signatures, and adds just enough logic to produce correct block signatures at the ends of functions. Differential Revision: https://reviews.llvm.org/D25144 llvm-svn: 283503
* [WebAssembly] Remove loop's bottom label.Dan Gohman2016-10-062-26/+16
| | | | | | | | Per spec changes, loop constructs no longer have a bottom label. https://reviews.llvm.org/D25118 llvm-svn: 283502
* [WebAssembly] Remove the output operand from stores.Dan Gohman2016-10-067-88/+64
| | | | | | | | | Per spec changes, store instructions in WebAssembly no longer have a return value. Update the instruction descriptions. Differential Revision: https://reviews.llvm.org/D25122 llvm-svn: 283501
* [WebAssembly] Add binary-encoding opcode values to instruction descriptions.Dan Gohman2016-10-058-133/+147
| | | | llvm-svn: 283389
* [WebAssembly] Update to more stack-machine-oriented terminology.Dan Gohman2016-10-038-28/+36
| | | | | | | | 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
* [WebAssemby] Clean up an obsolete comment.Dan Gohman2016-10-031-2/+1
| | | | | | The comment is present inside the body of GetVRegDef. llvm-svn: 283153
* [WebAssembly] Delete an unused function. NFC.Dan Gohman2016-10-031-5/+0
| | | | llvm-svn: 283150
* [WebAssembly] Fix indentation. NFC.Dan Gohman2016-10-031-1/+4
| | | | llvm-svn: 283147
* [WebAssembly] Rename OPERAND_FP32IMM to OPERAND_F32IMM.Dan Gohman2016-10-034-8/+8
| | | | | | | WebAssembly documentation consistently says "f32" rather than "fp32" to describe 32-bit floating-point. llvm-svn: 283146
* Use StringRef in Pass/PassManager APIs (NFC)Mehdi Amini2016-10-0117-23/+17
| | | | llvm-svn: 283004
* [WebAssembly] Make register stackification more conservativeDerek Schuff2016-09-301-19/+15
| | | | | | | | | | | | Register stackification currently checks VNInfo for changes. Make that more accurate by testing each intervening instruction for any other defs to the same virtual register. Patch by Jacob Gravelle Differential Revision: https://reviews.llvm.org/D24942 llvm-svn: 282886
* [WebAssembly] Use the frame pointer instead of the stack pointerDerek Schuff2016-09-261-4/+9
| | | | | | | | | | | When we have dynamic allocas we have a frame pointer, and when we're lowering frame indexes we should make sure we use it. Patch by Jacob Gravelle Differential Revision: https://reviews.llvm.org/D24889 llvm-svn: 282442
* Finish renaming remaining analyzeBranch functionsMatt Arsenault2016-09-142-4/+4
| | | | llvm-svn: 281535
* Make analyzeBranch family of instruction names consistentMatt Arsenault2016-09-142-2/+2
| | | | | | | analyzeBranch was renamed to use lowercase first, rename the related set to match. llvm-svn: 281506
* AArch64: Use TTI branch functions in branch relaxationMatt Arsenault2016-09-142-4/+12
| | | | | | | | | The main change is to return the code size from InsertBranch/RemoveBranch. Patch mostly by Tim Northover llvm-svn: 281505
* Fix WebAssembly broken build related to interface change in r281172.Eric Liu2016-09-121-2/+1
| | | | | | | | | | Reviewers: bkramer Subscribers: jfb, llvm-commits, dschuff Differential Revision: https://reviews.llvm.org/D24449 llvm-svn: 281201
* [WebAssembly] Fix typos in commentsHeejin Ahn2016-09-101-11/+14
| | | | llvm-svn: 281131
* [CodeGen] Rename MachineInstr::isInvariantLoad to ↵Justin Lebar2016-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | isDereferenceableInvariantLoad. NFC Summary: I want to separate out the notions of invariance and dereferenceability at the MI level, so that they correspond to the equivalent concepts at the IR level. (Currently an MI load is MI-invariant iff it's IR-invariant and IR-dereferenceable.) First step is renaming this function. Reviewers: chandlerc Subscribers: MatzeB, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D23370 llvm-svn: 281125
* [WebAssembly] Unbreak the build.Benjamin Kramer2016-09-051-8/+9
| | | | | | Not sure why ADL isn't working here. llvm-svn: 280656
* [WebAssembly] Update known test failuresDerek Schuff2016-09-021-1/+0
| | | | | | Fixed an issue with the experimental C headers llvm-svn: 280498
* [WebAssembly] Add asm.js-style setjmp/longjmp handling for wasm (reland r280302)Heejin Ahn2016-09-012-165/+776
| | | | | | | | | | | | Summary: This patch adds asm.js-style setjmp/longjmp handling support for WebAssembly. It also uses JavaScript's try and catch mechanism. Reviewers: jpp, dschuff Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D24121 llvm-svn: 280415
* Revert "Add asm.js-style setjmp/longjmp handling for wasm"Heejin Ahn2016-09-012-771/+165
| | | | | | This reverts commit r280302, it broke the integration tests. llvm-svn: 280329
* Add asm.js-style setjmp/longjmp handling for wasmHeejin Ahn2016-08-313-166/+772
| | | | | | | | | | | | Summary: This patch adds asm.js-style setjmp/longjmp handling support for WebAssembly. It also uses JavaScript's try and catch mechanism. Reviewers: jpp, dschuff Subscribers: jfb, dschuff Differential Revision: https://reviews.llvm.org/D23928 llvm-svn: 280302
* [WebAssembly] Disable folding of GA+reg into load/store constant offsetsDerek Schuff2016-08-311-6/+4
| | | | | | | | | | | Summary: If the register has a negative value then unsigned overflow will occur; this case is sometimes even created intentionally by LSR. For now disable GA+reg folding. Fixes PR29127 Differential Revision: https://reviews.llvm.org/D24053 llvm-svn: 280285
* MachineFunctionProperties/MIRParser: Rename AllVRegsAllocated->NoVRegs, ↵Matthias Braun2016-08-251-1/+1
| | | | | | | | | | | | | compute it Rename AllVRegsAllocated to NoVRegs. This avoids the connotation of running after register and simply describes that no vregs are used in a machine function. With that we can simply compute the property and do not need to dump/parse it in .mir files. Differential Revision: http://reviews.llvm.org/D23850 llvm-svn: 279698
* [WebAssembly] Change a comment lineHeejin Ahn2016-08-241-1/+2
| | | | | | Test for commit access. llvm-svn: 279683
* [SelectionDAG] Rename fextend -> fpextend, fround -> fpround, frnd -> froundMichael Kuperstein2016-08-181-2/+2
| | | | | | | | | | The names of the tablegen defs now match the names of the ISD nodes. This makes the world a slightly saner place, as previously "fround" matched ISD::FP_ROUND and not ISD::FROUND. Differential Revision: https://reviews.llvm.org/D23597 llvm-svn: 279129
* [WebAssembly] Disable the store-results optimization.Dan Gohman2016-08-181-20/+0
| | | | | | | | | | The WebAssemly spec removing the return value from store instructions, so remove the associated optimization from LLVM. This patch leaves the store instruction operands in place for now, so stores now always write to "$drop"; these will be removed in a seperate patch. llvm-svn: 279100
* [WebAssembly] Refactor WebAssemblyLowerEmscriptenException pass for ↵Derek Schuff2016-08-184-124/+182
| | | | | | | | | | | | | | | | | | | | | | setjmp/longjmp This patch changes the code structure of WebAssemblyLowerEmscriptenException pass to support both exception handling and setjmp/longjmp. It also changes the name of the pass and the source file. 1. Change the file/pass name to WebAssemblyLowerEmscriptenExceptions -> WebAssemblyLowerEmscriptenEHSjLj to make it clear that it supports both EH and SjLj 2. List function / global variable names at the top so they can be changed easily 3. Some cosmetic changes Patch by Heejin Ahn Differential Revision: https://reviews.llvm.org/D23588 llvm-svn: 279075
* [WebAssembly] Handle debug information and virtual registers without ↵Dominic Chen2016-08-173-3/+5
| | | | | | | | | | | | | | crashing (reland r278967) Summary: Currently, enabling debug information when compiling for WebAssembly crashes the backend. This commit fixes these by skipping debug values in backend passes. Reviewers: jfb, aprantl, dschuff, echristo Subscribers: llvm-commits, dschuff, jfb, MatzeB, dexonsmith, yurydelendik, mehdi_amini Differential Revision: https://reviews.llvm.org/D23635 llvm-svn: 279011
* Revert "[WebAssembly] Handle debug information and virtual registers without ↵Duncan P. N. Exon Smith2016-08-173-5/+3
| | | | | | | | | | crashing" This reverts commit r278967, since the new test is failing when you don't build the WebAssembly target (most people, since it's off-by-default). llvm-svn: 278973
OpenPOWER on IntegriCloud