Commit Graph

445 Commits

Author SHA1 Message Date
Chris Lattner
dbd820c6e5 teach memorypromotion about ProjectExistentialInst. Mention ARC optimization in SIL.rst.
Swift SVN r6435
2013-07-22 00:46:00 +00:00
Joe Groff
99874c0df4 SIL.rst: Wording.
Swift SVN r6420
2013-07-21 00:05:18 +00:00
Joe Groff
2b05858cd5 SIL.rst: Rework the "Syntax" section.
Describe the syntax entities as implemented by Chris and Manman in the parser.

Swift SVN r6419
2013-07-21 00:03:21 +00:00
Joe Groff
bb65bcd6d4 SIL.rst: Add a section about the SIL pipeline in the compiler.
Give an overview of the entire compiler pipeline followed by some description of where we're at and where we want to be with SILGen and the following SIL passes.

Swift SVN r6418
2013-07-20 21:44:32 +00:00
Joe Groff
e84798351b SIL.rst: Fill out the abstract.
Swift SVN r6417
2013-07-20 21:44:27 +00:00
Ted Kremenek
00bdd449e3 Misc. SIL document tidying.
Swift SVN r6238
2013-07-13 00:47:41 +00:00
Dave Abrahams
dc7ab3e57a Clean up remaining ReST errors in our documentation
Swift SVN r6025
2013-07-05 22:52:12 +00:00
Joe Groff
1f5bdda08f SIL: Add insns for archetype/protocol metatypes.
Archetype and protocol 'x.metatype' expressions eventually need to do a dynamic lookup, like 'x.metatype' for classes. These instructions represent that lookup.

Swift SVN r4534
2013-03-29 03:57:22 +00:00
Dave Abrahams
30d9e8821f *.rst: Use litre.TestsAreMissing exceptions
to avoid long processing times and reams of error messages for as-yet-untested files

Swift SVN r4508
2013-03-28 13:45:11 +00:00
Joe Groff
e8b66bce1d SIL: Rename implicit_convert to convert_function.
All the other implicit conversions have been given their own instructions, so specialize this ill-specified instruction to its one remaining use, for converting compatible function types.

Swift SVN r4482
2013-03-25 16:51:03 +00:00
Joe Groff
9da0f893e5 SIL: Add address_to_pointer instruction.
Make converting a SIL address to a Builtin.RawPointer its own instruction separate from implicit_convert, which will let me get rid of a goofy edge case in IRGenSIL.

Swift SVN r4412
2013-03-18 03:14:24 +00:00
Joe Groff
4437c65178 SIL: Add uncurry level to SILType.
We want to port CallEmission to the SIL level to handle uncurrying, but IRGen needs to have the original signature of a function available to it so that it can maintain the correct calling convention for different ABIs independent of SIL. Instead of flattening curried function types in SIL and losing that information, add an uncurryLevel to SILType so it can represent the type of an entry point at a given uncurry level. Unfortunately, this makes SILType outgrow a single word, so the way Value unions SILType and SILTypeList folding sets needs to be tweaked too.

Swift SVN r4345
2013-03-09 00:53:14 +00:00
Joe Groff
292f44af20 SILGen: Make address-only calling conv caller-copy
This is more in line with how IRGen currently behaves and with how loadable values are passed, and will make optimization of address-only functions easier.

Swift SVN r4343
2013-03-08 19:32:58 +00:00
Joe Groff
9703629f89 SIL.rst: Clean up some language.
Swift SVN r4329
2013-03-08 01:00:41 +00:00
Joe Groff
a44af3da9c SIL.rst: Describe some additional needed insns.
We need 'class_method' and 'super_method' to represent dynamic dispatch on class methods. We also need 'class_metatype' and 'existential_metatype' to obtain the runtime metatypes of class instances and existential containers.

Swift SVN r4321
2013-03-07 21:13:33 +00:00
Joe Groff
5e831ec2fe SIL.rst: Describe intended 'zero_addr' behavior.
zero_addr^Winitialize_var is a thing that should be magicked away either by turning subsequent assignments into initializations or by becoming a default constructor call. I don't think we need zero_value because 'initialize' pseudo-values should always originate from memory locations.

Swift SVN r4318
2013-03-07 18:38:23 +00:00
Joe Groff
c303ef1f7c SIL.rst: update ref_element_addr description.
Swift SVN r3780
2013-01-17 18:17:36 +00:00
Joe Groff
197b9e90e9 SILGen: Emit param patterns in reverse order.
Conform to IRGen's curried calling convention by emitting param patterns in reverse order, with the indirect return argument (if any) coming first.

Swift SVN r3777
2013-01-16 20:03:25 +00:00
Joe Groff
bb51760bdf SIL.rst: Describe calling convention for tuples.
Tuples recursively destructure, and the destructured elements then follow the normal calling convention.

Swift SVN r3748
2013-01-11 17:27:09 +00:00
Joe Groff
10924e22aa SIL.rst: Tidy up existential container description
Consistently use "existential container" to refer to the protocol-typed container object and "concrete value" to refer to the subobject owned by the existential container. Simplify the example a bit by removing the extraneous function call.

Swift SVN r3711
2013-01-09 00:02:36 +00:00
Joe Groff
da356c62ae SIL.rst: Existential terminology
Change the name of the implementation detail underlying protocol and protocol composition types to "existential container" while replacing references to "existential type" with "protocol or protocol composition type".

Swift SVN r3709
2013-01-08 04:25:36 +00:00
Joe Groff
5749e9024d SIL.rst: Catch up with the current state of SIL.
Swift SVN r3693
2013-01-05 01:30:44 +00:00
Joe Groff
7f3939f88a SIL.rst: Describe calling convention.
Loadable types are passed and returned at +1. Address-only arguments are passed by reference and callee-copied. Address-only return values are passed as an implicit argument to caller-owned uninitialized memory and are callee-initialized.

Swift SVN r3525
2012-12-17 19:24:17 +00:00
Joe Groff
57ad36d521 SIL.rst: Call addresses *T instead of Address<T>.
Swift SVN r3524
2012-12-17 19:24:15 +00:00
Joe Groff
e75c0198cd SIL.rst: Add descriptions for newly-added insns.
Also repaint the "existential" bikeshed since there's a loud preference for talking about existentials as existentials within the implementation.

Swift SVN r3523
2012-12-17 19:24:13 +00:00
Joe Groff
387ef69809 SIL.rst: ref_element_addr and generalize insns
Describe a `ref_element_addr` instruction for extracting elements from reference types and a `generalize` instruction for representation conversion of generic values.

Swift SVN r3432
2012-12-11 00:05:39 +00:00
Joe Groff
6a67ad7e12 SIL: Add ElementAddrInst.
Derives the address of a member from the address of a fragile value type. SIL extract : SIL element_addr :: LLVM extractvalue : LLVM getelementptr. Also add SILVerifier checks for ExtractInst and ElementAddrInst that they deal only in values and addresses, respectively.

Swift SVN r3391
2012-12-07 00:37:29 +00:00
Joe Groff
beaed00bea SIL.rst: Note insns that are unimplemented.
Also clarify the language for `string_literal`.

Swift SVN r3379
2012-12-06 17:24:23 +00:00
Joe Groff
9d4806a8f0 SIL.rst: More precisely list address-only types.
Instead of speaking vaguely about "concrete representation", list the categories of type that are loadable and that are address-only.

Swift SVN r3378
2012-12-06 17:12:33 +00:00
Joe Groff
b949713c89 SIL.rst: "existential" -> "protocol"
Swift SVN r3349
2012-12-04 19:06:31 +00:00
Joe Groff
70482aa51d SIL.rst: Describe instructions for existentials.
We'll need some additional instructions to describe initialization of existentials and existential method calls: `alloc_existential` to initialize an existential's witness and substitution table(s) and provide access to its storage, and `existential_method_ref`/`project_existential` to obtain a method handle from an existential and the opaque reference to hand down to the method.

Swift SVN r3348
2012-12-04 18:45:46 +00:00
Joe Groff
0453f5dbb2 SIL.rst: "dealloc_ref" shouldn't clean up values.
After discussion with John, we decided that we need to be able to deallocate a partially-initialized box during initializer execution, in case an initializer expression ends up unwinding before a value is fully initialized. When optimizing reference type allocations, it would also better to expose the destructor call and release operations directly instead of hiding them inside an instruction.

Swift SVN r3291
2012-11-29 19:29:43 +00:00
Joe Groff
e9849d725b SIL.rst: remove "destroy" instruction
Value types should not require destruction beyond `release`-ing their reference type members. `release` for reference types and `destroy_addr` for address-only types should cover all cleanup needs.

Swift SVN r3264
2012-11-27 22:20:45 +00:00
Chris Lattner
f59185141c Change integer_literal and friends to take a comma for consistency with other operations. Make a few more tweaks to the printer to match SIL.rst.
Swift SVN r3259
2012-11-27 18:48:30 +00:00
Joe Groff
ce3dc11614 SIL.rst: proofread
Swift SVN r3241
2012-11-26 17:48:35 +00:00
Chris Lattner
0e02c3cd12 80 columns
Swift SVN r3225
2012-11-17 01:16:49 +00:00
Joe Groff
ade9e3395a SIL.rst: Update per discussion with Chris and John
- Tighten up terminology, for instance, define what a "box" actually is
- Describe how operands can have zero, one, or many values
- Describe that only %operands are valid operands and loading constants, ints, and other literals requires distinct insns
- Make releasing a reftype and destroying a value distinct
- Describe how stack allocation of boxes and reftypes work
- Name address-only type operations `destroy_addr` and `copy_addr` to avoid confusion with rvalue operations
- Describe the full set of aggregate manipulation functions
- Clean up instruction notation to avoid ambiguities
- Throw in notes about things we need to design at some point

Swift SVN r3211
2012-11-16 22:38:37 +00:00
Joe Groff
19c1fddfcc SIL.rst: list convert insn's supported conversions
Swift SVN r3191
2012-11-15 01:41:27 +00:00
Joe Groff
312bd65dfe SIL.rst: resilient type example
Swift SVN r3190
2012-11-15 01:26:39 +00:00
Joe Groff
52e163fa00 SIL.rst: a couple examples
Swift SVN r3188
2012-11-15 00:04:25 +00:00
Joe Groff
85c6508122 SIL.rst: clean up notation
Swift SVN r3185
2012-11-14 19:19:57 +00:00
Joe Groff
a8f18017e1 SIL.rst: 80 columns
Swift SVN r3184
2012-11-14 19:19:55 +00:00
Joe Groff
048b50f3b9 SIL.rst: Describe the rest of the instructions
Also give some initial description of how functions and basic blocks work.

Swift SVN r3174
2012-11-14 05:12:28 +00:00
Joe Groff
8639a5d14b SIL.rst: Describe more instructions
Swift SVN r3166
2012-11-13 18:21:47 +00:00
Joe Groff
0c4ab942d4 Sketch out a SIL.rst
Describe type categorizations and memory management operations first because those were the hot topics of discussion today.

Swift SVN r3164
2012-11-13 01:35:35 +00:00