summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/WebAssembly
Commit message (Collapse)AuthorAgeFilesLines
...
* WebAssembly: use .skip instead of .zero directiveJF Bastien2016-01-071-5/+5
| | | | | | | | | | | | | | | | | .zero is confusing when used with two arguments. Documentation: This directive emits SIZE 0-valued bytes. SIZE must be an absolute expression. This directive is actually an alias for the '.skip' directive so in can take an optional second argument of the value to store in the bytes instead of zero. Using '.zero' in this way would be confusing however. Ref: https://sourceware.org/bugzilla/show_bug.cgi?id=18353 Hexagon and Sparc do the same, and it's all the same to WebAssembly so let's pick the less confusing of the two. llvm-svn: 257111
* [WebAssembly] Support combining GEP and FrameIndex offsets in memory operand ↵Derek Schuff2016-01-071-0/+21
| | | | | | | | | | | offset field Previously we only supported putting the FI into memory operand offset fields if there was nothing there already. Now combine them. Differential Revision: http://reviews.llvm.org/D15941 llvm-svn: 257084
* [WebAssembly] Use the default private label prefixes.Dan Gohman2016-01-074-384/+384
| | | | | | | | | The MC assembler doesn't like using the empty string as a private label prefix because then it treats all labels as private. This commit reverts back to the default prefix, which is .L, which is common in ELF targets and consistent with the LLVM name mangler. llvm-svn: 257083
* [WebAssembly] Add -m:e to the target triple.Dan Gohman2016-01-0746-49/+49
| | | | | | | This enables ELF-style name mangling, which primarily means using ".L" for private symbols. llvm-svn: 257020
* [WebAssembly] Don't use range-based loop for a list that's being modifiedDan Gohman2016-01-061-0/+1
| | | | | | | | The first instruction in a block is what the rend() iterator points to, so if it moves, we need to re-evaluate rend() so that we continue to iterate through the rest of the instructions. llvm-svn: 256953
* [WebAssembly] Add -asm-verbose=false to llc tests.Dan Gohman2016-01-061-8/+8
| | | | | | | In general, disabling comments in the output reduces the chances of a CHECK line accidentally matching a comment instead of its intended text. llvm-svn: 256946
* [SelectionDAGBuilder] Set NoUnsignedWrap for inbounds gep and load/store ↵Dan Gohman2016-01-061-0/+198
| | | | | | | | | | | | | | | | | | | | offsets. In an inbounds getelementptr, when an index produces a constant non-negative offset to add to the base, the add can be assumed to not have unsigned overflow. This relies on the assumption that addresses can't occupy more than half the address space, which isn't possible in C because it wouldn't be possible to represent the difference between the start of the object and one-past-the-end in a ptrdiff_t. Setting the NoUnsignedWrap flag is theoretically useful in general, and is specifically useful to the WebAssembly backend, since it permits stronger constant offset folding. Differential Revision: http://reviews.llvm.org/D15544 llvm-svn: 256890
* [WebAssembly] Fix handling of COPY instructions in WebAssemblyRegStackify.Dan Gohman2015-12-252-9/+47
| | | | | | | | | | | | | 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: remove 'external' from testJF Bastien2015-12-231-1/+4
| | | | | | | | | | | | Summary: Linker testing was sad at seeing an unresolved external symbol. For now don't do that: it's valid but we're not playing with multi-file linking yet, and the LLVM tests are used as hacky sanity tests for single-file linking (the GCC torture tests are much better for this purpose). Another solution would be to use '.extern' to make the intent explicit (don't simple-file link this, there's an unresolved symbol), some assemblers use '.extern' while others ignore it, so we wouldn't really be inventing anything new. Reviewers: sunfish, kripken Subscribers: jfb, llvm-commits, dschuff Differential Revision: http://reviews.llvm.org/D15753 llvm-svn: 256353
* WebAssembly: add vtable testJF Bastien2015-12-191-0/+171
| | | | | | The test will mainly be useful to check that the .s file assembles and relocates properly because vtables reference functions in their data section. llvm-svn: 256102
* [WebAssembly] Switch WebAssemblyMCAsmInfo.h from MCAsmInfo to MCAsmInfoELF.Dan Gohman2015-12-172-0/+22
| | | | llvm-svn: 255925
* [WebAssembly] Fix legalization of shift operators on large integer types.Dan Gohman2015-12-161-0/+9
| | | | llvm-svn: 255847
* [WebAssembly] Implement eliminateCallFramePseudoDerek Schuff2015-12-162-6/+13
| | | | | | | | | | | | | | | | | | Summary: Implement eliminateCallFramePsuedo to handle ADJCALLSTACKUP/DOWN pseudo-instructions. Add a test calling a vararg function which causes non-0 adjustments. This revealed an issue with RegisterCoalescer wherein it eliminates a COPY from SP32 to a vreg but failes to update the live ranges of EXPR_STACK, causing a machineinstr verifier failure (so this test is commented out). Also add a dynamic alloca test, which causes a callseq_end dag node with a 0 (instead of undef) second argument to be generated. We currently fail to select that, so adjust the ADJCALLSTACKUP tablegen code to handle it. Differential Revision: http://reviews.llvm.org/D15587 llvm-svn: 255844
* [WebAssembly] Print an extra local decl when the user stack pointer is usedDerek Schuff2015-12-161-0/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D15546 llvm-svn: 255815
* [WebAssembly] Fix the CFG Stackifier to handle unoptimized branchesDan Gohman2015-12-161-0/+46
| | | | | | | If a branch both branches to and falls through to the same block, treat it as an explicit branch. llvm-svn: 255803
* [WebAssembly] Use the new offset syntax for memory operands in inline asm.Dan Gohman2015-12-161-1/+1
| | | | llvm-svn: 255788
* [WebAssembly] Support more kinds of inline asm operandsDan Gohman2015-12-161-0/+15
| | | | llvm-svn: 255782
* [WebAssembly] Implement instruction selection for constant offsets in addresses.Dan Gohman2015-12-153-4/+189
| | | | | | | | | | | | | | | | | | | | Add instruction patterns for matching load and store instructions with constant offsets in addresses. The code is fairly redundant due to the need to replicate everything between imm, tglobaldadr, and texternalsym, but this appears to be common tablegen practice. The main alternative appears to be to introduce matching functions with C++ code, but sticking with purely generated matchers seems better for now. Also note that this doesn't yet support offsets from getelementptr, which will be the most common case; that will depend on a change in target-independent code in order to set the NoUnsignedWrap flag, which I'll submit separately. Until then, the testcase uses ptrtoint+add+inttoptr with a nuw on the add. Also implement isLegalAddressingMode with an approximation of this. Differential Revision: http://reviews.llvm.org/D15538 llvm-svn: 255681
* [WebAssembly] Remove .import printing.Dan Gohman2015-12-151-32/+0
| | | | | | | For now, LLVM doesn't know about wasm module imports, so it shouldn't emit .import directives. llvm-svn: 255602
* WebAssembly: test global array indexingJF Bastien2015-12-151-0/+9
| | | | | | This case was tested in the linker from code, but not from globals indexing into other globals. The linker currently barfs on this, ncbray volunteered to fix it. llvm-svn: 255601
* [WebAssembly] Add type prefixes to call instructionsDan Gohman2015-12-146-21/+21
| | | | | | | | | Add return type information to call and call_indirect instructions. This allows them to be disambiguated without knowledge of the callee. Differential Revision: http://reviews.llvm.org/D15484 llvm-svn: 255565
* [WebAssembly] Implement a new algorithm for placing BLOCK markersDan Gohman2015-12-141-11/+622
| | | | | | | | | 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] Implement prolog/epilog insertion and FrameIndex eliminationDerek Schuff2015-12-111-0/+70
| | | | | | | | | | | | | | | | | | Summary: Use the SP32 physical register as the base for FrameIndex lowering. Update it and the __stack_pointer global var in the prolog and epilog. Extend the mapping of virtual registers to wasm locals to include the physical registers. Rather than modify the target-independent PrologEpilogInserter (which asserts that there are no virtual registers left) include a slightly-modified copy for Wasm that does not have this assertion and only clears the virtual registers if scavenging was needed (which of course it isn't for wasm). Differential Revision: http://reviews.llvm.org/D15344 llvm-svn: 255392
* [WebAssembly] Tighten up several CHECK tests.Dan Gohman2015-12-104-18/+18
| | | | llvm-svn: 255255
* [WebAssembly] Implement mixed-type ISD::FCOPYSIGN.Dan Gohman2015-12-101-0/+28
| | | | | | | | ISD::FCOPYSIGN permits its operands to have differing types, and DAGCombiner uses this. Add some def : Pat rules to expand this out into an explicit conversion and a normal copysign operation. llvm-svn: 255220
* [WebAssembly] Implement fma.Dan Gohman2015-12-102-0/+18
| | | | | | It is lowered to a libcall for now, but this is expected to change in the future. llvm-svn: 255219
* [WebAssembly] Fix legalization of f32->f64 EXTLOAD.Dan Gohman2015-12-101-0/+20
| | | | llvm-svn: 255202
* [WebAssembly] Also legalize sign_extend_inreg of i32->i64.Dan Gohman2015-12-101-0/+9
| | | | llvm-svn: 255191
* PeepholeOptimizer: Ignore dead implicit defsDan Gohman2015-12-101-0/+28
| | | | | | | | Target-specific instructions may have uninteresting physreg clobbers, for target-specific reasons. The peephole pass doesn't need to concern itself with such defs, as long as they're implicit and marked as dead. llvm-svn: 255182
* [WebAssembly] Fix legalization of shift operators with illegal types.Dan Gohman2015-12-101-0/+24
| | | | llvm-svn: 255181
* [WebAssembly] Implement anyext.Dan Gohman2015-12-101-0/+11
| | | | llvm-svn: 255179
* [WebAssembly] Reintroduce ARGUMENT moving logicDan Gohman2015-12-096-7/+7
| | | | | | | | | | | | | | | | | | | Reinteroduce the code for moving ARGUMENTS back to the top of the basic block. While the ARGUMENTS physical register prevents sinking and scheduling from moving them, it does not appear to be sufficient to prevent SelectionDAG from moving them down in the initial schedule. This patch introduces a patch that moves them back to the top immediately after SelectionDAG runs. This is still hopefully a temporary solution. http://reviews.llvm.org/D14750 is one alternative, though the review has not been favorable, and proposed alternatives are longer-term and have other downsides. This fixes the main outstanding -verify-machineinstrs failures, so it adds -verify-machineinstrs to several tests. Differential Revision: http://reviews.llvm.org/D15377 llvm-svn: 255125
* [WebAssembly] Enable folding of offsets into global variable addresses.Dan Gohman2015-12-061-0/+45
| | | | llvm-svn: 254882
* [WebAssembly] Tighten up some testcase regular expressions.Dan Gohman2015-12-063-13/+13
| | | | llvm-svn: 254881
* [WebAssembly] Don't perform the returned-argument optimization on constants.Dan Gohman2015-12-051-0/+14
| | | | llvm-svn: 254866
* [WebAssembly] Implement direct calls to external symbols.Dan Gohman2015-12-052-2/+27
| | | | llvm-svn: 254863
* [WebAssembly] Support inline asm constraints of type i16 and similar.Dan Gohman2015-12-051-0/+16
| | | | llvm-svn: 254861
* [WebAssembly] Implement ReverseBranchCondition, and re-enable ↵Dan Gohman2015-12-053-28/+143
| | | | | | | | | | | | | MachineBlockPlacement This patch introduces a codegen-only instruction currently named br_unless, which makes it convenient to implement ReverseBranchCondition and re-enable the MachineBlockPlacement pass. Then in a late pass, it lowers br_unless back into br_if. Differential Revision: http://reviews.llvm.org/D14995 llvm-svn: 254826
* [WebAssembly] Fix scheduling dependencies in register-stackified codeDan Gohman2015-12-052-4/+32
| | | | | | | | | | | Add physical register defs to instructions used from stackified instructions to prevent them from being scheduled into the middle of a stack sequence. This is a conservative measure which may be loosened in the future. Differential Revision: http://reviews.llvm.org/D15252 llvm-svn: 254811
* [WebAssembly] Support constant offsets on loads and storesDerek Schuff2015-12-059-42/+42
| | | | | | | | | This is just prototype for load/store for i32 types. I'll add them to the rest of the types if we like this direction. Differential Revision: http://reviews.llvm.org/D15197 llvm-svn: 254807
* [WebAssembly] Initial varargs support.Dan Gohman2015-12-041-0/+122
| | | | | | | | | Full varargs support will depend on prologue/epilogue support, but this patch gets us started with most of the basic infrastructure. Differential Revision: http://reviews.llvm.org/D15231 llvm-svn: 254799
* [WebAssembly] Fix dominance check for PHIs in the StoreResult passDan Gohman2015-12-031-0/+43
| | | | | | | | | | | | | | When a block has no terminator instructions, getFirstTerminator() returns end(), which can't be used in dominance checks. Check dominance for phi operands separately. Also, remove some bits from WebAssemblyRegStackify.cpp that were causing trouble on the same testcase; they were left behind from an earlier experiment. Differential Revision: http://reviews.llvm.org/D15210 llvm-svn: 254662
* [WebAssembly] Add a test for wasm-store-results passDerek Schuff2015-12-031-0/+18
| | | | | | Differential Revision: http://reviews.llvm.org/D15167 llvm-svn: 254570
* [WebAssembly] Fix inline asm support for i64 operands.Dan Gohman2015-11-251-0/+13
| | | | llvm-svn: 254106
* [WebAssembly] Fold setne and seteq comparisons into selects.Dan Gohman2015-11-251-34/+126
| | | | llvm-svn: 254104
* [WebAssembly] Use a physical register to describe ARGUMENT liveness.Dan Gohman2015-11-251-1/+1
| | | | | | | | | | Instead of trying to move ARGUMENT instructions back up to the top after they've been scheduled or sunk down, use a fake physical register to create a liveness constraint that prevents ARGUMENT instructions from moving down in the first place. This is still not entirely ideal, however it is more robust than letting them move and moving them back. llvm-svn: 254084
* [WebAssembly] Make several tests more strict.Dan Gohman2015-11-257-51/+51
| | | | llvm-svn: 254077
* [WebAssembly] Support for register stackifying with load and store instructions.Dan Gohman2015-11-259-48/+125
| | | | llvm-svn: 254076
* [WebAssembly] Codegen support for ISD::ExternalSymbolDan Gohman2015-11-251-0/+12
| | | | llvm-svn: 254075
* [WebAssembly] Don't special-case call operand order.Dan Gohman2015-11-233-10/+10
| | | | | | | | With the '=' suffix now indicating which operands are output operands, it's no longer as important to distinguish between a call's inputs and its outputs using operand ordering, so we can go back to printing them in the normal order. llvm-svn: 253925
OpenPOWER on IntegriCloud