#
d08cd15f |
| 17-May-2016 |
Dan Gohman <dan433584@gmail.com> |
[WebAssembly] Don't stackify calls past stack pointer modifications.
llvm-svn: 269843
|
#
0cfb5f85 |
| 10-May-2016 |
Dan Gohman <dan433584@gmail.com> |
[WebAssembly] Move register stackification and coloring to a late phase.
Move the register stackification and coloring passes to run very late, after PEI, tail duplication, and most other passes. Th
[WebAssembly] Move register stackification and coloring to a late phase.
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
show more ...
|
#
450a8075 |
| 05-May-2016 |
Dan Gohman <dan433584@gmail.com> |
[WebAssembly] Don't emit epilogue code in the middle of stackified code.
llvm-svn: 268679
|
#
e1a2e90f |
| 31-Mar-2016 |
Hans Wennborg <hans@hanshq.net> |
Change eliminateCallFramePseudoInstr() to return an iterator
This will become necessary in a subsequent change to make this method merge adjacent stack adjustments, i.e. it might erase the previous
Change eliminateCallFramePseudoInstr() to return an iterator
This will become necessary in a subsequent change to make this method merge adjacent stack adjustments, i.e. it might erase the previous and/or next instruction.
It also greatly simplifies the calls to this function from Prolog- EpilogInserter. Previously, that had a bunch of logic to resume iteration after the call; now it just continues with the returned iterator.
Note that this changes the behaviour of PEI a little. Previously, it attempted to re-visit the new instruction created by eliminateCallFramePseudoInstr(). That code was added in r36625, but I can't see any reason for it: the new instructions will obviously not be pseudo instructions, they will not have FrameIndex operands, and we have already accounted for the stack adjustment.
Differential Revision: http://reviews.llvm.org/D18627
llvm-svn: 265036
show more ...
|
#
d4207ba0 |
| 17-Mar-2016 |
Derek Schuff <dschuff@google.com> |
[WebAssembly] Stackify code emitted by eliminateFrameIndex and SP writeback
Summary: MRI::eliminateFrameIndex can emit several instructions to do address calculations; these can usually be stackifie
[WebAssembly] Stackify code emitted by eliminateFrameIndex and SP writeback
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
show more ...
|
Revision tags: llvmorg-3.8.0, llvmorg-3.8.0-rc3 |
|
#
4b3bb213 |
| 23-Feb-2016 |
Derek Schuff <dschuff@google.com> |
[WebAssembly] Implement red zone for user stack
Implements a mostly-conventional redzone for the userspace stack. Because we have unsigned load/store offsets we continue to use a local SP subtracted
[WebAssembly] Implement red zone for user stack
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
show more ...
|
#
27e3b8a6 |
| 22-Feb-2016 |
Derek Schuff <dschuff@google.com> |
[WebAssembly] Fix writeback of stack pointer with dynamic alloca
Previously the stack pointer was only written back to memory in the prolog. But this is wrong for dynamic allocas, for which target-i
[WebAssembly] Fix writeback of stack pointer with dynamic alloca
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
show more ...
|
#
90dbb8cf |
| 20-Feb-2016 |
Derek Schuff <dschuff@google.com> |
[WebAssembly] Write stack pointer back to memory when FP is used
The stack pointer is bumped when there is a frame pointer or when there are static-size objects, but was only getting written back wh
[WebAssembly] Write stack pointer back to memory when FP is used
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
show more ...
|
#
dc5f6aa4 |
| 20-Feb-2016 |
Derek Schuff <dschuff@google.com> |
[WebAssembly] Stackify function prologs and epilogs
The instructions are the same, but fewer locals are used.
Differential Revision: http://reviews.llvm.org/D17428
llvm-svn: 261452
|
#
94c65660 |
| 16-Feb-2016 |
Dan Gohman <dan433584@gmail.com> |
[WebAssembly] Implement __builtin_frame_address.
Differential Revision: http://reviews.llvm.org/D17307
llvm-svn: 261032
|
#
3f063295 |
| 11-Feb-2016 |
Derek Schuff <dschuff@google.com> |
[WebAssembly] Reformat WebAssemblyFrameLowering and WebAssemblyISelLowering
Reviewers: sunfish, jfb
Subscribers: jfb, dschuff
Differential Revision: http://reviews.llvm.org/D17156
llvm-svn: 260585
|
#
992d83fd |
| 10-Feb-2016 |
Derek Schuff <dschuff@google.com> |
[WebAssembly] Address comments left over from r260421
llvm-svn: 260429
|
#
27501e20 |
| 10-Feb-2016 |
Derek Schuff <dschuff@google.com> |
[WebAssembly] Switch varags calling convention to use a register
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 s
[WebAssembly] Switch varags calling convention to use a register
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
show more ...
|
Revision tags: llvmorg-3.8.0-rc2 |
|
#
3ca3ea69 |
| 30-Jan-2016 |
JF Bastien <jfb@google.com> |
WebAssembly NFC: fix build warning
WebAssemblyFrameLowering.cpp:158:44: warning: enumeral and non-enumeral type in conditional expression [enabled by default]
llvm-svn: 259303
|
#
6ea637af |
| 29-Jan-2016 |
Derek Schuff <dschuff@google.com> |
[WebAssembly] Support frame pointer
Add support for frame pointer use in prolog/epilog. Supports dynamic allocas but not yet over-aligned locals. Target-independend CG generates SP updates, but we s
[WebAssembly] Support frame pointer
Add support for frame pointer use in prolog/epilog. Supports dynamic allocas but not yet over-aligned locals. Target-independend CG generates SP updates, but we still need to write back the SP value to memory when necessary.
llvm-svn: 259220
show more ...
|
#
90d9e8d3 |
| 26-Jan-2016 |
Derek Schuff <dschuff@google.com> |
[WebAssembly] Omit no-op adds for non-mem uses of FrameIndex
Differential Revision: http://reviews.llvm.org/D16554
llvm-svn: 258872
|
#
bb372243 |
| 26-Jan-2016 |
Dan Gohman <dan433584@gmail.com> |
[WebAssembly] Implement unaligned loads and stores.
Differential Revision: http://reviews.llvm.org/D16534
llvm-svn: 258779
|
Revision tags: llvmorg-3.8.0-rc1 |
|
#
3196650b |
| 19-Jan-2016 |
Dan Gohman <dan433584@gmail.com> |
[WebAssembly] Use the templated form of MachineFunction::getSubtarget(). NFC.
llvm-svn: 258126
|
#
8bb5f292 |
| 16-Dec-2015 |
Derek Schuff <dschuff@google.com> |
[WebAssembly] Implement eliminateCallFramePseudo
Summary: Implement eliminateCallFramePsuedo to handle ADJCALLSTACKUP/DOWN pseudo-instructions. Add a test calling a vararg function which causes non-
[WebAssembly] Implement eliminateCallFramePseudo
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
show more ...
|
#
9769debf |
| 11-Dec-2015 |
Derek Schuff <dschuff@google.com> |
[WebAssembly] Implement prolog/epilog insertion and FrameIndex elimination
Summary: Use the SP32 physical register as the base for FrameIndex lowering. Update it and the __stack_pointer global var
[WebAssembly] Implement prolog/epilog insertion and FrameIndex elimination
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
show more ...
|
Revision tags: llvmorg-3.7.1 |
|
#
7a6b9825 |
| 29-Nov-2015 |
Dan Gohman <dan433584@gmail.com> |
[WebAssembly] Minor clang-format and selected clang-tidy cleanups. NFC.
llvm-svn: 254267
|
#
9c54d3b4 |
| 25-Nov-2015 |
Dan Gohman <dan433584@gmail.com> |
[WebAssembly] Clean up several FIXME comments.
llvm-svn: 254079
|
Revision tags: llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1, llvmorg-3.7.0, llvmorg-3.7.0-rc4 |
|
#
e419a7c3 |
| 24-Aug-2015 |
Dan Gohman <dan433584@gmail.com> |
[WebAssembly] Use the checked form of MachineFunction::getSubtarget. NFC.
llvm-svn: 245852
|
Revision tags: llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2 |
|
#
b9073fb2 |
| 22-Jul-2015 |
JF Bastien <jfb@google.com> |
WebAssembly: basic bitcode → assembly CodeGen test
Summary: Add a basic CodeGen bitcode test which (for now) only prints out the function name and nothing else. The current code merely implements th
WebAssembly: basic bitcode → assembly CodeGen test
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
show more ...
|
Revision tags: llvmorg-3.7.0-rc1 |
|
#
c8f48c19 |
| 14-Jul-2015 |
JF Bastien <jfb@google.com> |
WebAssembly: fix build breakage.
Summary: processFunctionBeforeCalleeSavedScan was renamed to determineCalleeSaves and now takes a BitVector parameter as of rL242165, reviewed in http://reviews.llvm
WebAssembly: fix build breakage.
Summary: processFunctionBeforeCalleeSavedScan was renamed to determineCalleeSaves and now takes a BitVector parameter as of rL242165, reviewed in http://reviews.llvm.org/D10909
WebAssembly is still marked as experimental and therefore doesn't build by default. It does, however, grep by default! I notice that processFunctionBeforeCalleeSavedScan is still mentioned in a few comments and error messages, which I also fixed.
Reviewers: qcolombet, sunfish
Subscribers: jfb, dsanders, hfinkel, MatzeB, llvm-commits
Differential Revision: http://reviews.llvm.org/D11199
llvm-svn: 242242
show more ...
|