summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Fix WebAssemblyOptimizeReturned after r300367Jacob Gravelle2017-04-171-1/+1
| | | | | | | | | | | | | | | | Summary: Refactoring changed paramHasAttr(1 + i) to paramHasAttr(0), fix that to paramHasAttr(i). Add more tests to WebAssemblyOptimizeReturned that catch that regression. Reviewers: dschuff Subscribers: jfb, sbc100, llvm-commits Differential Revision: https://reviews.llvm.org/D32136 llvm-svn: 300502
* [WebAssembly] Encode block signatures as SLEB instead of ULEBDerek Schuff2017-04-171-0/+2
| | | | | | | | Use SLEB (varint) for block_type immediates in accordance with the spec. Patch by Yury Delendik llvm-svn: 300490
* Unbreak build of the wasm backend after r300463.Benjamin Kramer2017-04-171-2/+2
| | | | llvm-svn: 300479
* [IR] Make paramHasAttr to use arg indices instead of attr indicesReid Kleckner2017-04-141-1/+1
| | | | | | | | | This avoids the confusing 'CS.paramHasAttr(ArgNo + 1, Foo)' pattern. Previously we were testing return value attributes with index 0, so I introduced hasReturnAttr() for that use case. llvm-svn: 300367
* [IR] Make getParamAttributes take argument numbers, not ArgNo+1Reid Kleckner2017-04-132-14/+13
| | | | | | | | | | | | Add hasParamAttribute() and use it instead of hasAttribute(ArgNo+1, Kind) everywhere. The fact that the AttributeList index for an argument is ArgNo+1 should be a hidden implementation detail. NFC llvm-svn: 300272
* [IR] Take func, ret, and arg attrs separately in AttributeList::getReid Kleckner2017-04-131-8/+6
| | | | | | | | | | | | | This seems like a much more natural API, based on Derek Schuff's comments on r300015. It further hides the implementation detail of AttributeList that function attributes come last and appear at index ~0U, which is easy for the user to screw up. git diff says it saves code as well: 97 insertions(+), 137 deletions(-) This also makes it easier to change the implementation, which I want to do next. llvm-svn: 300153
* [WebAssembly] Update use of Attributes after r299875Derek Schuff2017-04-121-17/+14
| | | | | | This fixes the failing WebAssemblyLowerEmscriptenEHSjLj tests llvm-svn: 300072
* Revert "[WebAssembly] Update use of Attributes after r299875"Derek Schuff2017-04-121-14/+17
| | | | | | | | This reverts commit 2a0eb61dcccb15058d5b2a572bb3da0cf47fd550, r300015 I raced with rnk on the commit. llvm-svn: 300016
* [WebAssembly] Update use of Attributes after r299875Derek Schuff2017-04-121-17/+14
| | | | | | This fixes the failing WebAssemblyLowerEmscriptenEHSjLj tests llvm-svn: 300015
* [WebAssembly] Fix -Wcovered-switch-default warningDerek Schuff2017-04-061-2/+1
| | | | llvm-svn: 299736
* Fix WebAssembly after r299529.Alexander Kornienko2017-04-051-4/+4
| | | | llvm-svn: 299535
* [WebAssembly] Initial linking metadata supportDan Gohman2017-03-306-13/+90
| | | | | | | | | | | | | | | | Add support for the new relocations and linking metadata section support in https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md. In particular, this allows LLVM to indicate which variable is the stack pointer, so that it can be linked with other objects. This also adds support for emitting type relocations for call_indirect instructions. Right now, this is mainly tested by using wabt and hexdump to examine the output on selected testcases. We'll add more tests as the design stablizes and more of the pieces are in place. llvm-svn: 299141
* Rename AttributeSet to AttributeListReid Kleckner2017-03-214-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This class is a list of AttributeSetNodes corresponding the function prototype of a call or function declaration. This class used to be called ParamAttrListPtr, then AttrListPtr, then AttributeSet. It is typically accessed by parameter and return value index, so "AttributeList" seems like a more intuitive name. Rename AttributeSetImpl to AttributeListImpl to follow suit. It's useful to rename this class so that we can rename AttributeSetNode to AttributeSet later. AttributeSet is the set of attributes that apply to a single function, argument, or return value. Reviewers: sanjoy, javed.absar, chandlerc, pete Reviewed By: pete Subscribers: pete, jholewinski, arsenm, dschuff, mehdi_amini, jfb, nhaehnle, sbc100, void, llvm-commits Differential Revision: https://reviews.llvm.org/D31102 llvm-svn: 298393
* Fix wasm build after arg_begin iterator type changeReid Kleckner2017-03-171-1/+1
| | | | llvm-svn: 298106
* [WebAssembly] Fix some broken type encodings in wasm binaryDerek Schuff2017-03-162-3/+11
| | | | | | | | | | | | A recent change switch the in-memory wasm value types to be signed integers, but I missing a few cases where these were being writing to the binary. Differential Revision: https://reviews.llvm.org/D31014 Patch by Sam Clegg llvm-svn: 297991
* [WebAssembly] Use LEB encoding for value typesDerek Schuff2017-03-146-251/+222
| | | | | | | | | | | | Previously we were using the encoded LEB hex values for the value types. This change uses the decoded negative value and the LEB encoder to write them out. Differential Revision: https://reviews.llvm.org/D30847 Patch by Sam Clegg llvm-svn: 297777
* [WebAssembly] Fix the opcode numbers for floating-point le and gt.Dan Gohman2017-03-091-2/+2
| | | | llvm-svn: 297420
* [WebAssembly] Convert the remaining unit tests to the new wasm-object-file ↵Dan Gohman2017-02-282-0/+28
| | | | | | | | | | | target. To facilitate this, add a new hidden command-line option to disable the explicit-locals pass. That causes llc to emit invalid code that doesn't have all locals converted to get_local/set_local, however it simplifies testwriting in many cases. llvm-svn: 296540
* [WebAssembly] Add some comments and tidy up whitespace.Dan Gohman2017-02-273-3/+3
| | | | llvm-svn: 296402
* [WebAssembly] Split CFG-sorting into its own pass. NFC.Dan Gohman2017-02-277-223/+302
| | | | | | | CFG sorting was already an independent algorithm from block/loop insertion; this change makes it more convenient to debug. llvm-svn: 296399
* [WebAssembly] Add support for using a wasm global for the stack pointer.Dan Gohman2017-02-245-42/+112
| | | | | | | This replaces the __stack_pointer variable which was allocated in linear memory. llvm-svn: 296201
* [WebAssembly] Basic support for Wasm object file encoding.Dan Gohman2017-02-2423-140/+588
| | | | | | | | | With the "wasm32-unknown-unknown-wasm" triple, this allows writing out simple wasm object files, and is another step in a larger series toward migrating from ELF to general wasm object support. Note that this code and the binary format itself is still experimental. llvm-svn: 296190
* [WebAssembly] Handle f16 in fast-isel.Dan Gohman2017-02-241-0/+2
| | | | llvm-svn: 296172
* [WebAssembly] Add a README.txt entry for mergeable sections.Dan Gohman2017-02-241-0/+5
| | | | llvm-svn: 296095
* [WebAssembly] Define a table of function signatures for runtime library calls.Dan Gohman2017-02-223-0/+1345
| | | | | | | | | | LLVM CodeGen emits references to external symbols that are never declared in LLVM IR level, so they have no declared signature. However, WebAssembly requires all functions be declared with signatures. This patch adds a table for providing signatures for known runtime libcalls that will be used in subsequent patches to emit declarations for such functions. llvm-svn: 295857
* [WebAssembly] Configure codegen to legalize f16 values.Dan Gohman2017-02-221-0/+5
| | | | llvm-svn: 295850
* [WebAssembly] Add skeleton MC support for the Wasm container formatDan Gohman2017-02-2212-13/+248
| | | | | | | | | This just adds the basic skeleton for supporting a new object file format. All of the actual encoding will be implemented in followup patches. Differential Revision: https://reviews.llvm.org/D26722 llvm-svn: 295803
* [WebAssembly] Add a cast to void to fix an unused private member warning, ↵Dan Gohman2017-02-161-1/+3
| | | | | | for now. llvm-svn: 295327
* [WebAssembly] Remove old experimental disassemler code.Dan Gohman2017-02-111-84/+2
| | | | | | | Remove support for disassembling an old experimental wasm binary format, which is no longer in use anywhere. llvm-svn: 294809
* [WebAssembly] Pass an MCContext to WebAssemblyMCCodeEmitter. NFC.Dan Gohman2017-02-103-6/+10
| | | | llvm-svn: 294679
* [WebAssembly] Refactor void return peephole using MaybeRewriteToFallthrough. ↵Dan Gohman2017-02-091-13/+15
| | | | | | NFC. llvm-svn: 294652
* [WebAssembly] Add instruction definitions for drop and get/set_global.Dan Gohman2017-02-023-0/+18
| | | | llvm-svn: 293922
* [WebAssembly] Use print instead of dump method.Richard Trieu2017-01-281-2/+2
| | | | | | This fixes non-debug non-assert builds after r293359. llvm-svn: 293368
* [WebAssembly] Update LibFunc::Func -> LibFuncDerek Schuff2017-01-242-2/+2
| | | | | | Fixes compile failures after r292848 llvm-svn: 292857
* [WebAssembly] Don't create bitcast-wrappers for varargs.Dan Gohman2017-01-201-0/+5
| | | | | | | | | WebAssembly varargs functions use a significantly different ABI than non-varargs functions, and the current code in WebAssemblyFixFunctionBitcasts doesn't handle that difference. For now, just avoid creating wrapper functions in the presence of varargs. llvm-svn: 292645
* [WebAssembly] Update grow_memory's return type.Dan Gohman2017-01-181-2/+2
| | | | | | | The grow_memory instruction now returns the previous memory size. Add the return type to the LLVM intrinsic. llvm-svn: 292322
* [CodeGen] Rename MachineInstrBuilder::addOperand. NFCDiana Picus2017-01-132-5/+3
| | | | | | | | | | | Rename from addOperand to just add, to match the other method that has been added to MachineInstrBuilder for adding more than just 1 operand. See https://reviews.llvm.org/D28057 for the whole discussion. Differential Revision: https://reviews.llvm.org/D28556 llvm-svn: 291891
* [X86] updating TTI costs for arithmetic instructions on X86\SLM arch.Mohammed Agabaria2017-01-112-2/+3
| | | | | | | | | | | | updated instructions: pmulld, pmullw, pmulhw, mulsd, mulps, mulpd, divss, divps, divsd, divpd, addpd and subpd. special optimization case which replaces pmulld with pmullw\pmulhw\pshuf seq. In case if the real operands bitwidth <= 16. Differential Revision: https://reviews.llvm.org/D28104 llvm-svn: 291657
* [WebAssembly] Only RAUW a constant once in FixFunctionBitcastsDerek Schuff2017-01-101-5/+12
| | | | | | | | | | | | When we collect 2 uses of a function in FindUses and then RAUW when we visit the first, we end up visiting the wrapper (because the second was RAUW'd). We still want to use RAUW instead of just Use->set() because it has special handling for Constants, so this patch just ensures that only one use of each constant is added to the work list. Differential Revision: https://reviews.llvm.org/D28504 llvm-svn: 291603
* [WebAssembly] Add return type annotations in fast isel.Dan Gohman2017-01-091-0/+3
| | | | llvm-svn: 291498
* [WebAssembly] Fix the opcode values for i64.eq and i64.ne.Dan Gohman2017-01-091-2/+2
| | | | llvm-svn: 291424
* [WebAssembly] Don't abort on code with UB.Dan Gohman2017-01-071-6/+17
| | | | | | | | Gracefully leave code that performs function-pointer bitcasts implying non-trivial pointer conversions alone, rather than aborting, since it's just undefined behavior. llvm-svn: 291326
* [WebAssembly] Move a SmallVector to a more specific scope. NFC.Dan Gohman2017-01-071-2/+2
| | | | llvm-svn: 291324
* [WebAssembly] Add a pass to create wrappers for function bitcasts.Dan Gohman2017-01-074-0/+154
| | | | | | | | | | | | WebAssembly requires caller and callee signatures to match exactly. In LLVM, there are a variety of circumstances where signatures may be mismatched in practice, and one can bitcast a function address to another type to call it as that type. This patch adds a pass which replaces bitcasted function addresses with wrappers to replace the bitcasts. This doesn't catch everything, but it does match many common cases. llvm-svn: 291315
* [WebAssembly] Annotate call and load/store immediates.Dan Gohman2016-12-234-26/+36
| | | | | | These will be used to guide the binary encoding of these immediates. llvm-svn: 290412
* [WebAssembly] Add an "explicit" keyword to a constructor.Dan Gohman2016-12-221-1/+1
| | | | llvm-svn: 290345
* [WebAssembly] Don't use variadic operand indices in the MCOperandInfo array.Dan Gohman2016-12-221-4/+5
| | | | llvm-svn: 290344
* [WebAssembly] Don't old negative load/store offsets in fast-isel.Dan Gohman2016-12-221-9/+24
| | | | | | | WebAssembly's load/store offsets are unsigned and don't wrap, so it's not valid to fold in a negative offset. llvm-svn: 290342
* [WebAssembly] Fix the opcode value for i64.rotr.Dan Gohman2016-12-211-1/+1
| | | | llvm-svn: 290281
* [WebAssembly] Eliminate an ad-hoc command-line argument.Dan Gohman2016-12-032-7/+6
| | | | | | | Use the target triple to determine whether to run the explicit-locals pass, rather than using a separate command-line argument. llvm-svn: 288602
OpenPOWER on IntegriCloud