summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Use SelectionDAG::getUNDEF. NFC.Dan Gohman2015-12-041-1/+1
| | | | llvm-svn: 254726
* [WebAssembly] Assert that byval and nest are not used for return types.Dan Gohman2015-12-021-4/+2
| | | | llvm-svn: 254567
* [WebAssembly] Minor clang-format and selected clang-tidy cleanups. NFC.Dan Gohman2015-11-291-17/+18
| | | | llvm-svn: 254267
* [WebAssembly] Fix inline asm support for i64 operands.Dan Gohman2015-11-251-1/+5
| | | | llvm-svn: 254106
* [WebAssembly] Use a physical register to describe ARGUMENT liveness.Dan Gohman2015-11-251-0/+4
| | | | | | | | | | 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] Clean up several FIXME comments.Dan Gohman2015-11-251-2/+4
| | | | llvm-svn: 254079
* [WebAssembly] Codegen support for ISD::ExternalSymbolDan Gohman2015-11-251-0/+13
| | | | llvm-svn: 254075
* [WebAssembly] Add 'final' to some classes. NFC.Dan Gohman2015-11-251-1/+1
| | | | llvm-svn: 254073
* [WebAssembly] Whitespace consistency. NFC.Dan Gohman2015-11-251-1/+0
| | | | llvm-svn: 254071
* [WebAssembly] Rename SWITCH to TABLESWITCH to match the current wording in ↵Dan Gohman2015-11-201-3/+3
| | | | | | the spec. llvm-svn: 253642
* [WebAssembly] Implement isCheapToSpeculateCtlz and isCheapToSpeculateCttz.Dan Gohman2015-11-191-0/+10
| | | | | | | This unbreaks test/CodeGen/WebAssembly/i32.ll and test/CodeGen/WebAssembly/i64.ll after r224899. llvm-svn: 253617
* [WebAssembly] Fix function return type printingDerek Schuff2015-11-161-3/+0
| | | | | | | | | | | Summary: Previously return type information for a function was derived from return dag nodes. But this didn't work for dags with != return node. So instead compute it directly from the LLVM function as is done for imports. Differential Revision: http://reviews.llvm.org/D14593 llvm-svn: 253251
* [WebAssembly] Minor code simplification. NFC.Dan Gohman2015-11-141-3/+1
| | | | llvm-svn: 253150
* [WebAssembly] Support signext, zeroext, and several other function attributes.Dan Gohman2015-11-141-22/+0
| | | | llvm-svn: 253148
* [WebAssembly] Inline asm support.Dan Gohman2015-11-131-0/+17
| | | | llvm-svn: 252997
* [WebAssembly] Support non-legal argument and return types.Dan Gohman2015-11-111-13/+31
| | | | llvm-svn: 252687
* [WebAssembly] Support for floating point min and max.Dan Gohman2015-11-101-0/+3
| | | | llvm-svn: 252653
* [WebAssembly] Support 'unreachable' expressionDerek Schuff2015-11-101-0/+3
| | | | | | | | | | | | | | | Lower LLVM's 'unreachable' terminator to ISD::TRAP, and lower ISD::TRAP to wasm's 'unreachable' expression. WebAssembly type-checks expressions, but a noreturn function with a return type that doesn't match the context will cause a check failure. So we lower LLVM 'unreachable' to ISD::TRAP and then lower that to WebAssembly's 'unreachable' expression, which typechecks in any context and causes a trap if executed. Differential Revision: http://reviews.llvm.org/D14515 llvm-svn: 252566
* [WebAssembly] Switch to a more traditional assembly syntaxDan Gohman2015-10-061-1/+6
| | | | | | | | | | | This new syntax is built around putting each instruction on its own line in a "mnemonic op, op, op" like syntax. It also uses conventional data section directives like ".byte" and so on rather than requiring everything to be in hierarchical S-expression format. This is a more natural syntax for a ".s" file format from the perspective of LLVM MC and related tools, while remaining easy to translate into other forms as needed. llvm-svn: 249364
* [WebAssembly] Support calls marked as "tail", fastcc, and coldcc.Dan Gohman2015-10-021-4/+14
| | | | llvm-svn: 249184
* [WebAssembly] Rename several functions and types according to the new spec.Dan Gohman2015-09-261-4/+4
| | | | llvm-svn: 248644
* [WebAssembly] Check in an initial CFG Stackifier passDan Gohman2015-09-161-0/+51
| | | | | | | | | | | | 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
* [WebAssembly] Implement calls with void return types.Dan Gohman2015-09-091-1/+3
| | | | llvm-svn: 247158
* [WebAssembly] Fix lowering of calls with more than one argument.Dan Gohman2015-09-091-2/+5
| | | | llvm-svn: 247118
* WebAssembly: generate load/storeJF Bastien2015-08-311-2/+10
| | | | | | | | | Summary: This handles all load/store operations that WebAssembly defines, and handles those necessary for C++ such as i1. I left a FIXME for outstanding features which aren't required for now. Reviewers: sunfish Subscribers: jfb, llvm-commits, dschuff llvm-svn: 246500
* [WebAssembly] DYNAMIC_STACKALLOC returns a pointer.Dan Gohman2015-08-241-1/+1
| | | | llvm-svn: 245893
* WebAssembly: Implement callJF Bastien2015-08-241-20/+60
| | | | | | | | | | | | Summary: Support function calls. Reviewers: sunfish, sunfishcode Subscribers: sunfishcode, jfb, llvm-commits Differential revision: http://reviews.llvm.org/D12219 llvm-svn: 245887
* Revert two bad commits.JF Bastien2015-08-241-21/+19
| | | | | | | | | | Summary: I forgot to squash git commits before doing an svn dcommit of D12219. Reverting, and re-submitting. Subscribers: jfb, llvm-commits Differential Revision: http://reviews.llvm.org/D12298 llvm-svn: 245886
* Missing print.JF Bastien2015-08-241-13/+13
| | | | llvm-svn: 245883
* callJF Bastien2015-08-241-3/+70
| | | | llvm-svn: 245882
* [WebAssembly] Skeleton FastISel supportDan Gohman2015-08-241-0/+5
| | | | llvm-svn: 245860
* [WebAssembly] Implement floating point rounding operators.Dan Gohman2015-08-241-3/+6
| | | | llvm-svn: 245859
* [WebAssembly] Mark more operators as Expand.Dan Gohman2015-08-201-0/+26
| | | | llvm-svn: 245636
* WebAssembly: floating-point comparisonsJF Bastien2015-08-121-0/+2
| | | | | | | | | | | | | | | | | | Summary: D11924 implemented part of the floating-point comparisons, this patch implements the rest: * Tell ISelLowering that all booleans are either 0 or 1. * Expand the eq/ne/lt/le/gt/ge floating-point comparisons to the canonical ones (similar to what Mips32r6InstrInfo.td does). * Add tests for ord/uno. * Add tests for ueq/one/ult/ule/ugt/uge. * Fix existing comparison tests to remove the (res & 1) code, which setBooleanContents stops from generating. Reviewers: sunfish Subscribers: llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11970 llvm-svn: 244779
* WebAssembly: implement comparison.JF Bastien2015-08-111-3/+8
| | | | | | | | | | | | Some of the FP comparisons (ueq, one, ult, ule, ugt, uge) are currently broken, I'll fix them in a follow-up. Reviewers: sunfish Subscribers: llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11924 llvm-svn: 244665
* WebAssembly: implement WebAssemblyTargetLowering::getTargetNodeNameJF Bastien2015-08-111-0/+10
| | | | | | | | | | Summary: Implementation is the same as in AArch64. Subscribers: aemerson, jfb, llvm-commits, sunfish Differential Revision: http://reviews.llvm.org/D11956 llvm-svn: 244655
* WebAssembly: print immediatesJF Bastien2015-08-101-1/+5
| | | | | | | | | | | | | | | Summary: For now output using C99's hexadecimal floating-point representation. This patch also cleans up how machine operands are printed: instead of special-casing per type of machine instruction, the code now handles operands generically. Reviewers: sunfish Subscribers: llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11914 llvm-svn: 244520
* WebAssembly: implement getScalarShiftAmountTy so we can shift by amount, ↵JF Bastien2015-08-031-0/+5
| | | | | | | | | | | | with type Summary: This currently sets the shift amount RHS to the same type as the LHS, and assumes that the LHS is a simple type. This isn't currently the case e.g. with weird integers sizes, but will eventually be true and will assert if not. That's what you get for having an experimental backend: break it and you get to keep both pieces. Most backends either set the RHS to MVT::i32 or MVT::i64, but WebAssembly is a virtual ISA and tries to have regular-looking binary operations where both operands are the same type (even if a 64-bit RHS shifter is slightly silly, hey it's free!). Subscribers: llvm-commits, sunfish, jfb Differential Revision: http://reviews.llvm.org/D11715 llvm-svn: 243860
* WebAssembly: handle more than int32 argument/returnJF Bastien2015-08-011-2/+0
| | | | | | | | | | | | Summary: Also test 64-bit integers, except shifts for now which are broken because isel dislikes the 32-bit truncate that precedes them. Reviewers: sunfish Subscribers: llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11699 llvm-svn: 243822
* WebAssembly: handle `ret void`.JF Bastien2015-07-311-2/+1
| | | | | | | | | | | | | | | Summary: Use -1 as numoperands for the return SDTypeProfile, denoting that return is variadic. Note that the patterns in InstrControl.td still need to match the inputs, so this ins't an "anything goes" variadic on ret! The next step will be to handle other local types (not just int32). Reviewers: sunfish Subscribers: llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11692 llvm-svn: 243783
* WebAssembly: handle unused function arguments.JF Bastien2015-07-311-4/+6
| | | | | | | | Subscribers: llvm-commits, sunfish, jfb Differential Revision: http://reviews.llvm.org/D11684 llvm-svn: 243770
* WebAssembly: print basic integer assembly.JF Bastien2015-07-311-4/+38
| | | | | | | | | | | | | | | | | | | Summary: This prints assembly for int32 integer operations defined in WebAssemblyInstrInteger.td only, with major caveats: - The operation names are currently incorrect. - Other integer and floating-point types will be added later. - The printer isn't factored out to handle recursive AST code yet, since it can't even handle control flow anyways. - The assembly format isn't full s-expressions yet either, this will be added later. - This currently disables PrologEpilogCodeInserter as well as MachineCopyPropagation becasue they don't like virtual registers, which WebAssembly likes quite a bit. This will be fixed by factoring out NVPTX's change (currently a fork of PrologEpilogCodeInserter). Reviewers: sunfish Subscribers: llvm-commits, jfb Differential Revision: http://reviews.llvm.org/D11671 llvm-svn: 243763
* WebAssembly: basic bitcode → assembly CodeGen testJF Bastien2015-07-221-0/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add a basic CodeGen bitcode test which (for now) only prints out the function name and nothing else. The current code merely implements the basic needed for the test run to not crash / assert. Getting to that point required: - Basic InstPrinter. - Basic AsmPrinter. - DiagnosticInfoUnsupported (not strictly required, but nice to have, duplicated from AMDGPU/BPF's ISelLowering). - Some SP and register setup in WebAssemblyTargetLowering. - Basic LowerFormalArguments. - GenInstrInfo. - Placeholder LowerFormalArguments. - Placeholder CanLowerReturn and LowerReturn. - Basic DAGToDAGISel::Select, which requiresGenDAGISel.inc as well as GET_INSTRINFO_ENUM with GenInstrInfo.inc. - Remove WebAssemblyFrameLowering::determineCalleeSaves and rely on default. - Implement WebAssemblyFrameLowering::hasFP, same as AArch64's implementation. Follow-up patches will implement a real AsmPrinter, which will require adding MI opcodes specific to WebAssembly. Reviewers: sunfish Subscribers: aemerson, jfb, llvm-commits Differential Revision: http://reviews.llvm.org/D11369 llvm-svn: 242939
* [WebAssembly] Set the scheduling preference.Dan Gohman2015-07-071-0/+2
| | | | llvm-svn: 241637
* [WebAssembly] Set the HasFloatingPointExceptions flag for WebAssembly.Dan Gohman2015-07-021-1/+5
| | | | llvm-svn: 241302
* [WebAssembly] Initial WebAssembly backendDan Gohman2015-06-291-0/+59
This WebAssembly backend is just a skeleton at this time and is not yet functional. llvm-svn: 241022
OpenPOWER on IntegriCloud