commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
1992890f850c5077da503b1af5dadd181cc0d362
Jakob Stoklund Olesen
2017-02-17T19:57:32
Add a compilation context struct. This will provide main entry points for compiling functions, and it serves as a place for keeping data structures that should be preserved between function compilations to reduce allocator thrashing. So far, Context is just basic scaffolding. More to be added.
diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs new file mode 100644 index 000000000..2360302ea --- /dev/null +++ b/lib/cretonne/src/context.rs @@ -0,0 +1,23 @@ +//! Cretonne compilation context and main entry point. +//! +//! When compiling many small functions, it is important to avoid repeated...
2
35
10
b1769ac7e4ad454b2e17edfc2012f4938dd31bd7
Jakob Stoklund Olesen
2017-02-15T21:53:01
Cache the affinity in LiveValue. Most of the register allocator algorithms will only have to look at the currently live values as presented by LiveValueTracker. Many also need the value's affinity which is stored in the LiveRange associated with the value. Save the extra table lookup by caching the affinity value ins...
diff --git a/lib/cretonne/src/regalloc/live_value_tracker.rs b/lib/cretonne/src/regalloc/live_value_tracker.rs index cdbfebe28..838c5b6bb 100644 --- a/lib/cretonne/src/regalloc/live_value_tracker.rs +++ b/lib/cretonne/src/regalloc/live_value_tracker.rs @@ -9,6 +9,7 @@ use entity_list::{EntityList, ListPool}; use ir::i...
1
12
4
1fa3ddf0187e0c8d1474d013b3ef193a99532935
Jakob Stoklund Olesen
2017-02-15T00:00:33
Return RegInfo by value from TargetIsa::register_info(). The struct is just a pair of static references, and we don't need the double indirection.
diff --git a/lib/cretonne/src/isa/arm32/mod.rs b/lib/cretonne/src/isa/arm32/mod.rs index 63f629351..63e9516a1 100644 --- a/lib/cretonne/src/isa/arm32/mod.rs +++ b/lib/cretonne/src/isa/arm32/mod.rs @@ -49,8 +49,8 @@ impl TargetIsa for Isa { &self.shared_flags } - fn register_info(&self) -> &RegInfo { ...
7
11
10
408dc4e72ebdede00520b63634ae9dbd305e0503
Jakob Stoklund Olesen
2017-02-14T23:55:47
Add a contains_key method to SparseMap.
diff --git a/lib/cretonne/src/sparse_map.rs b/lib/cretonne/src/sparse_map.rs index 3a1b4dbdb..ad49ac49f 100644 --- a/lib/cretonne/src/sparse_map.rs +++ b/lib/cretonne/src/sparse_map.rs @@ -126,6 +126,11 @@ impl<K, V> SparseMap<K, V> None } + /// Return `true` if the map contains a value corresponding...
1
5
0
96e0a3273cbd5c8147298f38fb680d9d07e68176
Jakob Stoklund Olesen
2017-02-14T23:54:33
Return slices of live-ins and arguments from ebb_top(). The coloring algorithm needs to process these two types of live values differently, so we may as well provide the needed info.
diff --git a/lib/cretonne/src/regalloc/live_value_tracker.rs b/lib/cretonne/src/regalloc/live_value_tracker.rs index 02af0969d..cdbfebe28 100644 --- a/lib/cretonne/src/regalloc/live_value_tracker.rs +++ b/lib/cretonne/src/regalloc/live_value_tracker.rs @@ -129,12 +129,17 @@ impl LiveValueTracker { /// /// Thi...
1
9
1
2317142c753bbe95e63a6e64f3e313fd9de1e089
Jakob Stoklund Olesen
2017-02-14T23:52:44
Add a Layout::next_ebb() method. This lets us iterate over the blocks in a function without holding a reference to the layout.
diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs index 50dfa61f4..d30f33678 100644 --- a/lib/cretonne/src/ir/layout.rs +++ b/lib/cretonne/src/ir/layout.rs @@ -348,6 +348,11 @@ impl Layout { pub fn entry_block(&self) -> Option<Ebb> { self.first_ebb } + + /// Get the block ...
1
5
0
2c310416408cd87c4555136667fcb350af72bfd2
Jakob Stoklund Olesen
2017-02-06T15:54:29
Live Value Tracker. Keep track of which values are live and dead as we move through the instructions in an EBB.
diff --git a/lib/cretonne/src/lib.rs b/lib/cretonne/src/lib.rs index 436e2829e..bfd986949 100644 --- a/lib/cretonne/src/lib.rs +++ b/lib/cretonne/src/lib.rs @@ -25,4 +25,5 @@ mod constant_hash; mod predicates; mod legalizer; mod ref_slice; +mod partition_slice; mod packed_option; diff --git a/lib/cretonne/src/regal...
4
260
0
5579e9b4a5055b44b565a6a8f9336a5fe3d8a089
Jakob Stoklund Olesen
2017-02-06T17:06:37
Add a partition_slice function. Partition the elements in a mutable slice according to a predicate.
diff --git a/lib/cretonne/src/partition_slice.rs b/lib/cretonne/src/partition_slice.rs new file mode 100644 index 000000000..9626b5fd3 --- /dev/null +++ b/lib/cretonne/src/partition_slice.rs @@ -0,0 +1,75 @@ +//! Rearrange the elements in a slice according to a predicate. + +/// Rearrange the elements of the mutable sl...
1
75
0
5a1d9561a7da60a362423212791b213dc4a6f360
Mikko Perttunen
2017-02-14T12:04:03
Coalesce live range intervals in adjacent EBBs LiveRanges represent the live-in range of a value as a sorted list of intervals. Each interval starts at an EBB and continues to an instruction. Before this commit, the LiveRange would store an interval for each EBB. This commit changes the representation such that interv...
diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs index f914142c7..50dfa61f4 100644 --- a/lib/cretonne/src/ir/layout.rs +++ b/lib/cretonne/src/ir/layout.rs @@ -102,6 +102,13 @@ impl ProgramOrder for Layout { let b_seq = self.seq(b); a_seq.cmp(&b_seq) } + + fn is_ebb_ga...
3
115
11
f6391c57e8758c1f5649699df137df0a50701f8b
Jakob Stoklund Olesen
2017-02-03T23:06:05
Compute register affinities during liveness analysis. Each live range has an affinity hint containing the preferred register class (or stack slot). Compute the affinity by merging the constraints of the def and all uses.
diff --git a/lib/cretonne/src/regalloc/liveness.rs b/lib/cretonne/src/regalloc/liveness.rs index 2e6cb78db..fe43b6962 100644 --- a/lib/cretonne/src/regalloc/liveness.rs +++ b/lib/cretonne/src/regalloc/liveness.rs @@ -175,39 +175,87 @@ //! //! There is some room for improvement. -use regalloc::liverange::LiveRange; ...
2
103
70
f8e4d4e839bce74f43760105ef749be7494e8947
Jakob Stoklund Olesen
2017-02-03T20:28:07
Speling.
diff --git a/lib/cretonne/src/cfg.rs b/lib/cretonne/src/cfg.rs index f68d8bcbf..546635581 100644 --- a/lib/cretonne/src/cfg.rs +++ b/lib/cretonne/src/cfg.rs @@ -1,8 +1,9 @@ //! A control flow graph represented as mappings of extended basic blocks to their predecessors -//! and successors. Successors are represented as...
22
112
110
dab96d8ea29efed59f956ce4f1a653f13793ae71
Jakob Stoklund Olesen
2017-01-27T22:31:14
Add entity lists. Like a vector, but with a tiny footprint, and allocated from a pool so all memory can be released very quickly.
diff --git a/lib/cretonne/src/entity_list.rs b/lib/cretonne/src/entity_list.rs new file mode 100644 index 000000000..6ec23e39e --- /dev/null +++ b/lib/cretonne/src/entity_list.rs @@ -0,0 +1,519 @@ +//! Small lists of entity references. +//! +//! This module defines an `EntityList<T>` type which provides similar functio...
2
520
0
5eba3db4e01e9d929c2631379e41e7768f8a68d9
Jakob Stoklund Olesen
2017-01-20T05:01:54
Remove EntityRef::wrap(). This has been superceded by PackedOption.
diff --git a/lib/cretonne/src/entity_map.rs b/lib/cretonne/src/entity_map.rs index ba2075370..33d355e9f 100644 --- a/lib/cretonne/src/entity_map.rs +++ b/lib/cretonne/src/entity_map.rs @@ -24,24 +24,6 @@ pub trait EntityRef: Copy + Eq { /// Get the index that was used to create this entity reference. fn ind...
1
0
18
2e19fa8e074a917591dd376ba265a1167e3401d3
Jakob Stoklund Olesen
2017-01-20T00:07:16
Remove NO_INST and the Default+Ord impls for Inst. Clean up comments. Add an assertion to check that PackedOption is working as designed.
diff --git a/lib/cretonne/src/ir/entities.rs b/lib/cretonne/src/ir/entities.rs index e0b1477af..69a990215 100644 --- a/lib/cretonne/src/ir/entities.rs +++ b/lib/cretonne/src/ir/entities.rs @@ -13,15 +13,14 @@ //! The `entities` module defines public types for the entity references along with constants //! representin...
1
22
18
02bf84431b19e093a1627aaadb049fe76d970e29
Jakob Stoklund Olesen
2017-01-20T02:44:33
Use PackedOption<Inst> in the dominator tree. Also rework the algorithm to be more robust against unreachable blocks. - Add an is_reachable(ebb) method. - Change idom(ebb) to just return an instruction. - Make idom() return None for the entry block as well as unreachable blocks.
diff --git a/cranelift/src/filetest/domtree.rs b/cranelift/src/filetest/domtree.rs index 306fc433e..0a570e325 100644 --- a/cranelift/src/filetest/domtree.rs +++ b/cranelift/src/filetest/domtree.rs @@ -41,7 +41,7 @@ impl SubTest for TestDomtree { fn run(&self, func: Cow<Function>, context: &Context) -> Result<()> {...
3
183
96
4aa5c313ea96021e1942e694d7f1dabdd7500691
Jakob Stoklund Olesen
2017-01-20T02:44:33
Use PackedOption<Inst> in the dominator tree. Also rework the algorithm to be more robust against unreachable blocks. - Add an is_reachable(ebb) method. - Change idom(ebb) to just return an instruction. - Make idom() return None for the entry block as well as unreachable blocks.
diff --git a/lib/cretonne/src/dominator_tree.rs b/lib/cretonne/src/dominator_tree.rs index e331f5657..f940d3c91 100644 --- a/lib/cretonne/src/dominator_tree.rs +++ b/lib/cretonne/src/dominator_tree.rs @@ -1,116 +1,195 @@ //! A Dominator Tree represented as mappings of Ebbs to their immediate dominator. -use cfg::*; ...
3
183
96
1389a51c7a002f2ea231a382b85f40fbd3568097
Jakob Stoklund Olesen
2017-01-19T22:49:55
Avoid using NO_INST in the parser. This was only used for the comment rewrite mechanism, and we can just predict the next allocated instruction number instead. See the other uses of next_key() for gather_comments().
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 7e843d0c8..7ab9ee24d 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -301,6 +301,14 @@ impl DataFlowGraph { self.insts.push(data) } + /// Get the instruction reference that will be assigned to the n...
2
11
19
bdc0f53c91515250590c35066ae52cfc3521b36b
Jakob Stoklund Olesen
2017-01-19T22:26:47
Use PackedOption<Inst> in the Layout implementation. This also revealed that the last_inst() method should return an Option.
diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs index 2092329fb..2a8d1ba4a 100644 --- a/lib/cretonne/src/ir/layout.rs +++ b/lib/cretonne/src/ir/layout.rs @@ -5,9 +5,9 @@ use std::cmp; use std::iter::{Iterator, IntoIterator}; -use entity_map::{EntityMap, EntityRef}; +use entity_map::Entity...
2
42
45
b8200d7be9a8a5ca34b1b9558cd89aeacea50c2d
Jakob Stoklund Olesen
2017-01-19T21:59:57
Use PackedOption<Ebb> in the Layout implementation. The doubly linked lists are terminated with None. Remove NO_EBB and the Default impl for Ebb.
diff --git a/lib/cretonne/src/ir/entities.rs b/lib/cretonne/src/ir/entities.rs index 0b01fa9a7..119873777 100644 --- a/lib/cretonne/src/ir/entities.rs +++ b/lib/cretonne/src/ir/entities.rs @@ -72,15 +72,6 @@ impl Ebb { } } -/// A guaranteed invalid EBB reference. -pub const NO_EBB: Ebb = Ebb(u32::MAX); - -impl ...
3
49
47
2f6a33f16d89ada671659d3d66b2e1aae47a95ae
Jakob Stoklund Olesen
2017-01-19T21:41:56
Use PackedOption<Ebb> to represent jump tables. Avoid NO_EBB.
diff --git a/lib/cretonne/src/ir/jumptable.rs b/lib/cretonne/src/ir/jumptable.rs index cbd8630e4..824e2dcf2 100644 --- a/lib/cretonne/src/ir/jumptable.rs +++ b/lib/cretonne/src/ir/jumptable.rs @@ -3,7 +3,8 @@ //! Jump tables are declared in the preamble and assigned an `ir::entities::JumpTable` reference. //! The act...
3
33
33
7b8239d0760ffe29da088ec5b171434f15f75e9d
Jakob Stoklund Olesen
2017-01-19T21:15:50
Remove Default implementations from many entity references. These types can be wrapped in a PackedOption now, so we don't need the NO_* constants and default values.
diff --git a/lib/cretonne/src/ir/entities.rs b/lib/cretonne/src/ir/entities.rs index ed42b3363..0b01fa9a7 100644 --- a/lib/cretonne/src/ir/entities.rs +++ b/lib/cretonne/src/ir/entities.rs @@ -208,57 +208,21 @@ impl Default for Value { pub struct StackSlot(u32); entity_impl!(StackSlot, "ss"); -/// A guaranteed inva...
1
0
36
8a30bae9092076540f03eff0924613a91624678c
Jakob Stoklund Olesen
2017-01-19T20:34:18
Move duplicated entity code into a macro. Implement ReservedValue for all the entities.
diff --git a/lib/cretonne/src/ir/entities.rs b/lib/cretonne/src/ir/entities.rs index 4570a2100..ed42b3363 100644 --- a/lib/cretonne/src/ir/entities.rs +++ b/lib/cretonne/src/ir/entities.rs @@ -20,25 +20,51 @@ //! format. use entity_map::EntityRef; +use packed_option::ReservedValue; use std::default::Default; use ...
1
42
118
b42faea98099e75f751cb58bd0c7809ae1e4ebb4
Jakob Stoklund Olesen
2017-01-19T20:13:00
Implement PackedOption to address #19. The PackedOption<T> struct uses the same amount of memory as T, but can represent None via a reserved value.
diff --git a/lib/cretonne/src/lib.rs b/lib/cretonne/src/lib.rs index 67694e139..25feb3c0d 100644 --- a/lib/cretonne/src/lib.rs +++ b/lib/cretonne/src/lib.rs @@ -24,3 +24,4 @@ mod constant_hash; mod predicates; mod legalizer; mod ref_slice; +mod packed_option; diff --git a/lib/cretonne/src/packed_option.rs b/lib/cret...
2
122
0
aec53ec3a9070da8d5754c6969481e8442b4f8c8
Jakob Stoklund Olesen
2017-01-13T19:42:26
Add a liveness analysis. This code is best tested with larger functions with more EBBs. Perhaps a new file-test category is in order?
diff --git a/lib/cretonne/src/ir/instructions.rs b/lib/cretonne/src/ir/instructions.rs index 21f9b92c3..eb0b1e5bd 100644 --- a/lib/cretonne/src/ir/instructions.rs +++ b/lib/cretonne/src/ir/instructions.rs @@ -412,8 +412,8 @@ pub struct ReturnData { impl InstructionData { /// Execute a closure once for each argume...
4
304
4
05e06cb876a3194a2bdced22d7b0bce63f565ecc
Jakob Stoklund Olesen
2017-01-10T23:33:03
Implement DoubleEndedIterator for the ebb_insts() iterator. Make it possible to iterate backwards over the instructions in an EBB.
diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs index cecc8645e..7f2497df1 100644 --- a/lib/cretonne/src/ir/layout.rs +++ b/lib/cretonne/src/ir/layout.rs @@ -452,7 +452,8 @@ impl Layout { pub fn ebb_insts<'f>(&'f self, ebb: Ebb) -> Insts<'f> { Insts { layout: self, ...
1
31
7
b5715d5c48ca492dd839f4cfd8badd4554fe03be
Jakob Stoklund Olesen
2017-01-10T22:21:56
Allow live ranges to be values in a SparseMap. This requires the value number to be stored in the live range itself.
diff --git a/lib/cretonne/src/regalloc/liverange.rs b/lib/cretonne/src/regalloc/liverange.rs index b26dc8e8b..e192efdc4 100644 --- a/lib/cretonne/src/regalloc/liverange.rs +++ b/lib/cretonne/src/regalloc/liverange.rs @@ -108,7 +108,8 @@ //! use std::cmp::Ordering; -use ir::{Inst, Ebb, ProgramPoint, ProgramOrder}; +...
1
27
9
748fbd993ea3fd83ae7575e1a6786dc40efc877b
Jakob Stoklund Olesen
2017-01-10T21:51:20
Add iteration support to SparseMap. This is simply the slice iterator for the dense vector. - map.values() returns an iterator with references to the values. - for i in &map iterates over references to the values.
diff --git a/lib/cretonne/src/sparse_map.rs b/lib/cretonne/src/sparse_map.rs index 5194d8a76..9f0d93a55 100644 --- a/lib/cretonne/src/sparse_map.rs +++ b/lib/cretonne/src/sparse_map.rs @@ -37,6 +37,7 @@ use entity_map::{EntityRef, EntityMap}; use std::mem; +use std::slice; use std::u32; /// Trait for extracting...
1
35
0
d9b63bf22749c75987bd937ebe39992a1ebaaac3
Jakob Stoklund Olesen
2017-01-10T18:01:05
Implement a SparseMap data structure. This implements the classic Briggs/Torczon sparse set construct. Adapt it to our existing EntityRef infrastructure so we can use types keys instead of just integers like the original paper does. Also provide a SparseSet<T> type alias which implements a sparse set of entity refee...
diff --git a/lib/cretonne/src/lib.rs b/lib/cretonne/src/lib.rs index 6445d7866..67694e139 100644 --- a/lib/cretonne/src/lib.rs +++ b/lib/cretonne/src/lib.rs @@ -14,6 +14,7 @@ pub mod isa; pub mod cfg; pub mod dominator_tree; pub mod entity_map; +pub mod sparse_map; pub mod settings; pub mod verifier; pub mod rega...
2
298
0
b6c2d4588f591903c2639cf22db27e4cc99e4d9f
Jakob Stoklund Olesen
2017-01-05T18:34:19
Add a LiveRange data structure. We will track live ranges separately for each SSA value, rather than per virtual register like LLVM does. This is the basis for a register allocator, so place it in a new regalloc module.
diff --git a/lib/cretonne/src/ir/mod.rs b/lib/cretonne/src/ir/mod.rs index 7e0562264..f4b2a337b 100644 --- a/lib/cretonne/src/ir/mod.rs +++ b/lib/cretonne/src/ir/mod.rs @@ -28,4 +28,4 @@ pub use ir::dfg::{DataFlowGraph, ValueDef}; pub use ir::layout::{Layout, Cursor}; pub use ir::function::Function; pub use ir::buil...
5
519
3
ae28ef90ef672dff53d986fa944d78642e59d0cc
Jakob Stoklund Olesen
2017-01-05T22:03:09
Encourage better optimization of ProgramOrder::cmp. The ProgramOrder::cmp() comparison is often used where one or both arguments are statically known to be an Inst or Ebb. Give the compiler a better chance to discover this via inlining and other optimizations. - Make cmp() generic with Into<ExpandedProgramPoint> boun...
diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs index 16f5aa548..cecc8645e 100644 --- a/lib/cretonne/src/ir/layout.rs +++ b/lib/cretonne/src/ir/layout.rs @@ -7,7 +7,7 @@ use std::cmp; use std::iter::{Iterator, IntoIterator}; use entity_map::{EntityMap, EntityRef}; use ir::entities::{Ebb, N...
2
42
19
7b04f5bb31fc38c831475625335d460db8962b23
Jakob Stoklund Olesen
2016-12-29T01:05:00
Implement ProgramOrder for Layout. Assign sequence numbers to both instructions and EBB headers such that their relative position can be determined in constant time simply by comparing sequence numbers. Implement the sequence numbers with a scheme similar to the line numbers used in BASIC programs. Start out with 10,...
diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs index bdcf4cdd5..16f5aa548 100644 --- a/lib/cretonne/src/ir/layout.rs +++ b/lib/cretonne/src/ir/layout.rs @@ -3,9 +3,11 @@ //! The order of extended basic blocks in a function and the order of instructions in an EBB is //! determined by the `L...
1
237
12
29276679b13b32863319b86757956fc31e816487
Jakob Stoklund Olesen
2016-12-20T23:50:29
Add program points. Program points are used to represent a linear position in a function. Thus will be used for the live ranges of values.
diff --git a/lib/cretonne/src/ir/mod.rs b/lib/cretonne/src/ir/mod.rs index 738c6336d..7e0562264 100644 --- a/lib/cretonne/src/ir/mod.rs +++ b/lib/cretonne/src/ir/mod.rs @@ -14,6 +14,7 @@ mod funcname; mod extfunc; mod builder; mod valueloc; +mod progpoint; pub use ir::funcname::FunctionName; pub use ir::extfunc:...
2
99
0
e1c5abaff5f80df0aafeb7f6d01fcd16bffbcb52
Jakob Stoklund Olesen
2016-12-08T23:57:28
Add a ValueLoc type and the locations table. This table holds the result of register allocation.
diff --git a/lib/cretonne/src/ir/entities.rs b/lib/cretonne/src/ir/entities.rs index df7d81988..4570a2100 100644 --- a/lib/cretonne/src/ir/entities.rs +++ b/lib/cretonne/src/ir/entities.rs @@ -98,6 +98,17 @@ impl Default for Inst { #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] pub struct Value(u32); +impl Enti...
4
43
2
4460adbfc206d372d7a9d52591531985cc4aa096
Jakob Stoklund Olesen
2016-11-04T22:19:44
Write out value aliases when writing instructions. If an instruction uses any values that are aliases of other values, print out the alias mappings on lines preceding the instruction. This is necessary to reconstruct the data flow graph. We don't make any attempt to only write out each alias mapping once. The parser...
diff --git a/lib/cretonne/src/write.rs b/lib/cretonne/src/write.rs index ac487c6f3..d8db064cd 100644 --- a/lib/cretonne/src/write.rs +++ b/lib/cretonne/src/write.rs @@ -145,11 +145,28 @@ fn type_suffix(func: &Function, inst: Inst) -> Option<Type> { Some(rtype) } +// Write out any value aliases appearing in `ins...
1
19
2
55bc5599cc0c4bc2b200a014c4bd2c206bc4416f
Jakob Stoklund Olesen
2016-11-04T22:27:34
Fix off-by-one in resolve_values. When the extended_values table is empty, the value to resolve is definitely not an alias, but we still need as least one trip in the loop to determine that.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 0d24bc2d1..7e843d0c8 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -137,7 +137,8 @@ impl DataFlowGraph { use ir::entities::ExpandedValue::Table; let mut v = value; - for _ in 0..self.exten...
1
7
2
dc2afb24d92cdb790a4565c5d2aca1b22f32bee4
Jakob Stoklund Olesen
2016-11-04T19:30:51
Add a ref_slice module. Utility functions for converting &T to an &[T] slice with a single element.
diff --git a/lib/cretonne/src/lib.rs b/lib/cretonne/src/lib.rs index aef83bd43..51a8d9b36 100644 --- a/lib/cretonne/src/lib.rs +++ b/lib/cretonne/src/lib.rs @@ -21,3 +21,4 @@ mod write; mod constant_hash; mod predicates; mod legalizer; +mod ref_slice; diff --git a/lib/cretonne/src/ref_slice.rs b/lib/cretonne/src/ref...
2
19
0
8d6d59cc7aaca0959f9fcefcd81ab8bf733d2009
Jakob Stoklund Olesen
2016-11-04T17:34:14
Gather comments in the preamble of a test file. Comments preceding the first function are not associated with any specific entity in the file. Put them in a TestFile::preamble_comments field.
diff --git a/lib/reader/src/lib.rs b/lib/reader/src/lib.rs index 25aa25aa9..61473afe3 100644 --- a/lib/reader/src/lib.rs +++ b/lib/reader/src/lib.rs @@ -10,7 +10,7 @@ extern crate cretonne; pub use error::{Location, Result, Error}; pub use parser::{parse_functions, parse_test}; pub use testcommand::{TestCommand, Tes...
3
20
2
1c57f436432dc79706be64880e89f2a111a81237
Jakob Stoklund Olesen
2016-11-04T15:44:01
Add Cursor::set_position. Make it possible to move a cursor to a new position. In the current implementation of Layout and Cursor, this is a trivial operation, but if we switch to a B-tree based function layout, this involves navigating the tree.
diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs index fdd230574..bdcf4cdd5 100644 --- a/lib/cretonne/src/ir/layout.rs +++ b/lib/cretonne/src/ir/layout.rs @@ -381,6 +381,11 @@ impl<'f> Cursor<'f> { self.pos } + /// Move the cursor to a new position. + pub fn set_position(...
1
5
0
e59b47c41a0bf932bca3e4add7346dbd72d3cfc2
Jakob Stoklund Olesen
2016-11-04T01:59:32
Return a Result from the TargetIsa::encode() method. When an instruction can't be encoded, provide a viable legalization action in the form of a Legalize enum.
diff --git a/lib/cretonne/src/isa/enc_tables.rs b/lib/cretonne/src/isa/enc_tables.rs index 185e162f7..d0a371dbc 100644 --- a/lib/cretonne/src/isa/enc_tables.rs +++ b/lib/cretonne/src/isa/enc_tables.rs @@ -3,7 +3,7 @@ //! This module contains types and functions for working with the encoding tables generated by //! `l...
4
64
40
814d1728aafea39c6f6a1ca76eee88c73fae1800
Jakob Stoklund Olesen
2016-11-04T00:55:41
Add a Value::unwrap_direct() method. When it is known that a value is the first result of an instruction, it is safe to unwrap the instruction reference.
diff --git a/lib/cretonne/src/ir/entities.rs b/lib/cretonne/src/ir/entities.rs index 384e4d3ae..df7d81988 100644 --- a/lib/cretonne/src/ir/entities.rs +++ b/lib/cretonne/src/ir/entities.rs @@ -164,6 +164,19 @@ impl Value { Table(index) } } + + /// Assuming that this is a direct value, get ...
1
13
0
e2418c6ec9dd7f911c8de2350b23a5ab1a92c014
Jakob Stoklund Olesen
2016-10-27T00:43:18
Require documentation on reader public items.
diff --git a/lib/reader/src/error.rs b/lib/reader/src/error.rs index cf8bd12f0..c49e523b7 100644 --- a/lib/reader/src/error.rs +++ b/lib/reader/src/error.rs @@ -8,13 +8,16 @@ use std::result; /// The location of a `Token` or `Error`. #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] pub struct Location { + //...
4
21
0
447baf015e6f68d3a61ee9dabf59a49bd1427ffd
Jakob Stoklund Olesen
2016-10-27T00:34:45
Require documentation on filecheck public items.
diff --git a/lib/filecheck/src/lib.rs b/lib/filecheck/src/lib.rs index f6c53c5dc..66fe6036a 100644 --- a/lib/filecheck/src/lib.rs +++ b/lib/filecheck/src/lib.rs @@ -234,6 +234,8 @@ //! This will match `"one, two"` , but not `"one,two"`. Without the `$()`, trailing whitespace //! would be trimmed from the pattern. +...
2
4
0
cf1996b036139c26824e409bd1230efc9bb430b0
Jakob Stoklund Olesen
2016-10-21T00:24:14
Introduce value aliases. A extended value can now be changed to a third form: An alias of another value. This is like a copy instruction, but implicit in the value table. Value aliases are used in lieu of use-def chains which would be used to implement replace-all-uses-with. Added new DFG methods: - change_to_alias...
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 903fd48dd..0d24bc2d1 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -2,7 +2,7 @@ use ir::{Ebb, Inst, Value, Type, SigRef, Signature, FuncRef}; use ir::entities::{NO_VALUE, ExpandedValue}; -use ir::instructions::{...
1
148
2
3791e8660d82c3592d41913cdf6977edea3f9d6e
Jakob Stoklund Olesen
2016-10-21T17:39:05
Make Type::as_bool() less pedantic for scalars. All scalar types are mapped to b1 which is usually what you want for a scalar. Vector types have their lanes mapped to the wider boolean types. Add an as_bool_pedantic() methos that produces the scalar sized boolean types as before. Also add a friendlier Debug implemen...
diff --git a/lib/cretonne/src/ir/types.rs b/lib/cretonne/src/ir/types.rs index 99390ee22..f1e099840 100644 --- a/lib/cretonne/src/ir/types.rs +++ b/lib/cretonne/src/ir/types.rs @@ -1,7 +1,7 @@ //! Common types for the Cretonne code generator. use std::default::Default; -use std::fmt::{self, Display, Formatter}; +us...
1
45
4
ce9049af90a6ddf13220b3be28036406770fe3f1
Jakob Stoklund Olesen
2016-10-21T16:56:55
Implement From<i64> for Imm64. This makes it possible to use literal integers as arguments to InstBuilder methods.
diff --git a/lib/cretonne/src/ir/immediates.rs b/lib/cretonne/src/ir/immediates.rs index e8d4a2077..0395d13f2 100644 --- a/lib/cretonne/src/ir/immediates.rs +++ b/lib/cretonne/src/ir/immediates.rs @@ -28,6 +28,12 @@ impl Into<i64> for Imm64 { } } +impl From<i64> for Imm64 { + fn from(x: i64) -> Self { + ...
1
6
0
1305283ed8b00fdad5fc34c7bcd89977e62414ce
Jakob Stoklund Olesen
2016-10-21T16:44:24
Move the 'ins' method to DataFlowGraph. This given us better symmetry between the replace and insert builder operations: dfg.replace(inst).iadd(x, y) dfg.ins(cursor).imul(x, y)
diff --git a/lib/cretonne/src/cfg.rs b/lib/cretonne/src/cfg.rs index a50d4ff89..76ccc2796 100644 --- a/lib/cretonne/src/cfg.rs +++ b/lib/cretonne/src/cfg.rs @@ -184,16 +184,16 @@ mod tests { let jmp_ebb1_ebb2; { - let mut cur = Cursor::new(&mut func.layout); let dfg = &mut fu...
4
19
18
8422976d785d98796eb0f9b3c73a27a740fb17e6
Jakob Stoklund Olesen
2016-10-20T20:09:37
Add a ReplaceBuilder instruction builder. The DataFlowGraph::replace(inst) method returns an instruction builder that will replace an instruction in-place. This will be used when transforming instructions, replacing an old instruction with a new (legal) way of computing its primary value. Since primary result values ...
diff --git a/lib/cretonne/src/ir/builder.rs b/lib/cretonne/src/ir/builder.rs index e9f859cd7..7df5a6aa3 100644 --- a/lib/cretonne/src/ir/builder.rs +++ b/lib/cretonne/src/ir/builder.rs @@ -92,3 +92,91 @@ impl<'c, 'fc, 'fd> InstBuilderBase<'fd> for InsertBuilder<'c, 'fc, 'fd> { (inst, self.dfg) } } + +///...
2
141
2
d763bedeaa7e29a8562427f792b31400c16811b9
Jakob Stoklund Olesen
2016-10-20T18:16:58
Rename Builder to InsertBuilder. This instruction builder inserts an instruction at the cursor position. We'll add other kinds of builders shortly.
diff --git a/lib/cretonne/src/ir/builder.rs b/lib/cretonne/src/ir/builder.rs index 6ad50d9ab..e9f859cd7 100644 --- a/lib/cretonne/src/ir/builder.rs +++ b/lib/cretonne/src/ir/builder.rs @@ -48,40 +48,30 @@ include!(concat!(env!("OUT_DIR"), "/builder.rs")); /// Any type implementing `InstBuilderBase` gets all the `InstB...
2
16
26
78312c6c46756441ee276fc9d432706a6888e384
Jakob Stoklund Olesen
2016-10-20T01:50:11
Add a Cursor::ins() method which constructs a Builder. Rewrite Builder uses in test cases to use this method and construct a new builder for each instruction. This pattern allows us to change the InstBuilder trait to a one-shot implementation that can only create a single instruction. Don't re-export the Builder stru...
diff --git a/lib/cretonne/src/cfg.rs b/lib/cretonne/src/cfg.rs index 59ced57d8..a50d4ff89 100644 --- a/lib/cretonne/src/cfg.rs +++ b/lib/cretonne/src/cfg.rs @@ -139,7 +139,7 @@ impl ControlFlowGraph { #[cfg(test)] mod tests { use super::*; - use ir::{Function, Builder, InstBuilder, Cursor, VariableArgs, types...
4
29
22
4cd33b210eaa3f0b5c58d144046ab450119a38dd
Jakob Stoklund Olesen
2016-10-20T01:27:22
Use more precise lifetimes for Builder. Distinguish the lifetime of the Cursor and its referenced function layout. Use two separate function lifetimes: 'fc and 'fd. The borrow checker seems to get confused if we don't.
diff --git a/lib/cretonne/src/ir/builder.rs b/lib/cretonne/src/ir/builder.rs index e8646d0dd..a36026313 100644 --- a/lib/cretonne/src/ir/builder.rs +++ b/lib/cretonne/src/ir/builder.rs @@ -49,15 +49,15 @@ impl<T: InstBuilderBase> InstBuilder for T {} /// /// A `Builder` holds mutable references to a data flow graph a...
1
6
6
499fefebd9b84ddd950cd1563d2e9214d3168072
Jakob Stoklund Olesen
2016-10-19T23:23:08
Rename lifetimes in layout.rs to 'f These lifetimes all represent the lifetime of the Function.
diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs index c6543a88e..864420c4f 100644 --- a/lib/cretonne/src/ir/layout.rs +++ b/lib/cretonne/src/ir/layout.rs @@ -123,7 +123,7 @@ impl Layout { } /// Return an iterator over all EBBs in layout order. - pub fn ebbs<'a>(&'a self) -> Ebb...
1
15
15
cdb141d138d857bd82b8223eb6f6c3b98fb11703
Jakob Stoklund Olesen
2016-10-19T19:03:50
Also rebuild if build.rs itself changes. We already have all the meta/**.py as dependencies.
diff --git a/lib/cretonne/build.rs b/lib/cretonne/build.rs index 47e289021..2067a37af 100644 --- a/lib/cretonne/build.rs +++ b/lib/cretonne/build.rs @@ -23,6 +23,11 @@ fn main() { let cur_dir = env::current_dir().expect("Can't access current working directory"); let crate_dir = cur_dir.as_path(); + // Ma...
1
5
0
1e18e66ebe4f71a1c38f570013bd5ab52a91fc2d
Jakob Stoklund Olesen
2016-10-18T20:28:38
Bump filecheck version to 0.0.1, allow publication.
diff --git a/lib/filecheck/Cargo.toml b/lib/filecheck/Cargo.toml index f7cfa926e..ee31a8fa4 100644 --- a/lib/filecheck/Cargo.toml +++ b/lib/filecheck/Cargo.toml @@ -1,11 +1,11 @@ [package] authors = ["The Cretonne Project Developers"] name = "filecheck" -version = "0.0.0" +version = "0.0.1" description = "Library f...
1
2
2
cdb63a547e85e82b1625f0d40768e6343d81e991
Jakob Stoklund Olesen
2016-10-18T19:31:37
Add result values to call instructions too. The make_inst_results() method now understands direct and indirect calls, and can allocate result values matching the return types of the function call.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index b913f505e..35b0af4dc 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -2,7 +2,7 @@ use ir::{Ebb, Inst, Value, Type, SigRef, Signature, FuncRef}; use ir::entities::{NO_VALUE, ExpandedValue}; -use ir::instructions::I...
2
71
11
1bcb8e25a2b5456827028acad344e7463570980d
Jakob Stoklund Olesen
2016-10-18T17:07:44
Add signatures and ext_funcs tables to DataFlowGraph. These two tables are used to keep track of type signatures of function calls as well as external function references used in direct function calls. Also add an ExtFuncData struct representing an external function that can be called directly.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 35bb9c8f7..b913f505e 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -1,8 +1,9 @@ //! Data flow graph tracking Instructions, Values, and EBBs. -use ir::{Ebb, Inst, Value, Type}; +use ir::{Ebb, Inst, Value, Type, Si...
4
41
3
b8a76822cfd0a41a25ac788a6626f8d15dde0f1f
Jakob Stoklund Olesen
2016-10-18T16:43:20
Track signatures and function references in the source map.
diff --git a/lib/reader/src/sourcemap.rs b/lib/reader/src/sourcemap.rs index 5808670fa..26d874817 100644 --- a/lib/reader/src/sourcemap.rs +++ b/lib/reader/src/sourcemap.rs @@ -8,7 +8,7 @@ //! clients. use std::collections::HashMap; -use cretonne::ir::{StackSlot, JumpTable, Ebb, Value}; +use cretonne::ir::{StackSlo...
1
35
1
80a6ae203d603e4e68702e55e9d884a23bbf58cf
Jakob Stoklund Olesen
2016-10-18T16:31:19
Generalize def_inst() to def_entity(). Use this source map method for assigning a location to any entity whose source number is not exposed. This could be - Instructions. - Signatures defined implicitly by function decls. These entities only appear in the location map, not the entity number maps.
diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs index 5c86e4e21..89786ed2b 100644 --- a/lib/reader/src/parser.rs +++ b/lib/reader/src/parser.rs @@ -837,7 +837,7 @@ impl<'a> Parser<'a> { let inst = ctx.function.dfg.make_inst(inst_data); let num_results = ctx.function.dfg.make_inst_resu...
2
11
19
846db00a219eac703892b3caca30babaeb00de77
Jakob Stoklund Olesen
2016-10-17T21:44:43
Move library crates under 'lib/'. Give these crates each a more standard directory layout with sources in a 'src' sub-sirectory and Cargo.toml in the top lib/foo directory. Add license and description fields to each. The build script for the cretonne crate now lives in 'lib/cretonne/build.rs' separating it from the ...
diff --git a/cranelift/src/libcretonne/build.rs b/cranelift/src/libcretonne/build.rs deleted file mode 100644 index 2cb13ac95..000000000 --- a/cranelift/src/libcretonne/build.rs +++ /dev/null @@ -1,46 +0,0 @@ - -// Build script. -// -// This program is run by Cargo when building libcretonne. It is used to generate Rust...
52
64
64
0764df28b54ee3bf5a1910f6ed0e278df08fab29
Jakob Stoklund Olesen
2016-10-17T21:44:43
Move library crates under 'lib/'. Give these crates each a more standard directory layout with sources in a 'src' sub-sirectory and Cargo.toml in the top lib/foo directory. Add license and description fields to each. The build script for the cretonne crate now lives in 'lib/cretonne/build.rs' separating it from the ...
diff --git a/src/libcretonne/Cargo.toml b/lib/cretonne/Cargo.toml similarity index 91% rename from src/libcretonne/Cargo.toml rename to lib/cretonne/Cargo.toml index 174fb2e0b..60e8eb2be 100644 --- a/src/libcretonne/Cargo.toml +++ b/lib/cretonne/Cargo.toml @@ -3,6 +3,7 @@ authors = ["The Cretonne Project Developers"] ...
52
64
64
680387a53ad8b3b68766652cc9167f8d958131c8
Jakob Stoklund Olesen
2016-10-14T22:17:34
Remove test_utils. These test utilities have been subsumed by ir::Builder.
diff --git a/cranelift/src/libcretonne/lib.rs b/cranelift/src/libcretonne/lib.rs index 26a87bd22..ae2515724 100644 --- a/cranelift/src/libcretonne/lib.rs +++ b/cranelift/src/libcretonne/lib.rs @@ -23,6 +23,3 @@ mod write; mod constant_hash; mod predicates; mod legalizer; - -#[cfg(test)] -pub mod test_utils; diff --g...
3
0
43
8480879f3ef3228e102575f33d88c857a2441119
Jakob Stoklund Olesen
2016-10-14T22:17:34
Remove test_utils. These test utilities have been subsumed by ir::Builder.
diff --git a/src/libcretonne/lib.rs b/src/libcretonne/lib.rs index 26a87bd22..ae2515724 100644 --- a/src/libcretonne/lib.rs +++ b/src/libcretonne/lib.rs @@ -23,6 +23,3 @@ mod write; mod constant_hash; mod predicates; mod legalizer; - -#[cfg(test)] -pub mod test_utils; diff --git a/src/libcretonne/test_utils/make_ins...
3
0
43
98308177cc5198746e30007feb2a5febe26f6181
Jakob Stoklund Olesen
2016-10-14T22:16:29
Switch domtree tests to using Builder.
diff --git a/cranelift/src/libcretonne/dominator_tree.rs b/cranelift/src/libcretonne/dominator_tree.rs index c741b5992..0e34a2c02 100644 --- a/cranelift/src/libcretonne/dominator_tree.rs +++ b/cranelift/src/libcretonne/dominator_tree.rs @@ -116,10 +116,9 @@ impl DominatorTree { #[cfg(test)] mod test { use super:...
1
23
16
af8f8d98e6f4ff8edb937525b215ea212cebc526
Jakob Stoklund Olesen
2016-10-14T22:16:29
Switch domtree tests to using Builder.
diff --git a/src/libcretonne/dominator_tree.rs b/src/libcretonne/dominator_tree.rs index c741b5992..0e34a2c02 100644 --- a/src/libcretonne/dominator_tree.rs +++ b/src/libcretonne/dominator_tree.rs @@ -116,10 +116,9 @@ impl DominatorTree { #[cfg(test)] mod test { use super::*; - use ir::Function; + use ir::...
1
23
16
8fb8a41f8ecd256d1d42005af3c942ca4146e0db
Jakob Stoklund Olesen
2016-10-14T22:02:58
Give Builder a Cursor. The Builder keeps track of a position in the layout and inserts new instructions there. Add insert_ebb() and ebb() methods to Builder. Use Builder in the cfg tests.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 8397ca516..aab576ae8 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -139,9 +139,7 @@ impl ControlFlowGraph { #[cfg(test)] mod tests { use super::*; - use ir::Function; - - use tes...
2
48
16
d4197ca73184c8b917f295afa052b747adc33b85
Jakob Stoklund Olesen
2016-10-14T22:02:58
Give Builder a Cursor. The Builder keeps track of a position in the layout and inserts new instructions there. Add insert_ebb() and ebb() methods to Builder. Use Builder in the cfg tests.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 8397ca516..aab576ae8 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -139,9 +139,7 @@ impl ControlFlowGraph { #[cfg(test)] mod tests { use super::*; - use ir::Function; - - use test_utils::make_inst; + use ir::{Functi...
2
48
16
7aef6bd535eee62d7a1c827e4476f3cd04e2c0bd
Jakob Stoklund Olesen
2016-10-14T21:01:49
Add Cursor::insert_ebb() method. Insert an EBB at the current position and switch to inserting instructions there. Call the relevant Layout methods to do so.
diff --git a/cranelift/src/libcretonne/ir/layout.rs b/cranelift/src/libcretonne/ir/layout.rs index b1263a5b4..c6543a88e 100644 --- a/cranelift/src/libcretonne/ir/layout.rs +++ b/cranelift/src/libcretonne/ir/layout.rs @@ -614,6 +614,36 @@ impl<'a> Cursor<'a> { After(ebb) => self.layout.append_inst(inst, ebb...
1
30
0
eb5cea7c6ae23ab0ea2c4932ba4c4c114d2e47fc
Jakob Stoklund Olesen
2016-10-14T21:01:49
Add Cursor::insert_ebb() method. Insert an EBB at the current position and switch to inserting instructions there. Call the relevant Layout methods to do so.
diff --git a/src/libcretonne/ir/layout.rs b/src/libcretonne/ir/layout.rs index b1263a5b4..c6543a88e 100644 --- a/src/libcretonne/ir/layout.rs +++ b/src/libcretonne/ir/layout.rs @@ -614,6 +614,36 @@ impl<'a> Cursor<'a> { After(ebb) => self.layout.append_inst(inst, ebb), } } + + /// Insert a...
1
30
0
a41b34c11ce7c83715e6e73d9db249128342000f
Jakob Stoklund Olesen
2016-10-14T20:54:26
Add Layout::insert_ebb_after() method. Symmetrical with the existing insert_ebb().
diff --git a/cranelift/src/libcretonne/ir/layout.rs b/cranelift/src/libcretonne/ir/layout.rs index b8d10739e..b1263a5b4 100644 --- a/cranelift/src/libcretonne/ir/layout.rs +++ b/cranelift/src/libcretonne/ir/layout.rs @@ -102,6 +102,26 @@ impl Layout { } } + /// Insert `ebb` in the layout *after* the ...
1
72
19
8592979fc9ca2e030f70d82418aeebd0ba8a2f88
Jakob Stoklund Olesen
2016-10-14T20:54:26
Add Layout::insert_ebb_after() method. Symmetrical with the existing insert_ebb().
diff --git a/src/libcretonne/ir/layout.rs b/src/libcretonne/ir/layout.rs index b8d10739e..b1263a5b4 100644 --- a/src/libcretonne/ir/layout.rs +++ b/src/libcretonne/ir/layout.rs @@ -102,6 +102,26 @@ impl Layout { } } + /// Insert `ebb` in the layout *after* the existing EBB `after`. + pub fn insert...
1
72
19
d1fd91021d339155a574eb8c0fa42f2f1dcbcc7b
Jakob Stoklund Olesen
2016-10-14T19:33:54
Add Layout::split_ebb(). This method splits an EBB in two and moves trailing instructions to a new EBB.
diff --git a/cranelift/src/libcretonne/ir/layout.rs b/cranelift/src/libcretonne/ir/layout.rs index 48943ffc1..b8d10739e 100644 --- a/cranelift/src/libcretonne/ir/layout.rs +++ b/cranelift/src/libcretonne/ir/layout.rs @@ -221,6 +221,71 @@ impl Layout { next: self.ebbs[ebb].first_inst.wrap(), } ...
1
140
0
10c579e0cd6daa5b6ddbcd5adf2628c9b2183a27
Jakob Stoklund Olesen
2016-10-14T19:33:54
Add Layout::split_ebb(). This method splits an EBB in two and moves trailing instructions to a new EBB.
diff --git a/src/libcretonne/ir/layout.rs b/src/libcretonne/ir/layout.rs index 48943ffc1..b8d10739e 100644 --- a/src/libcretonne/ir/layout.rs +++ b/src/libcretonne/ir/layout.rs @@ -221,6 +221,71 @@ impl Layout { next: self.ebbs[ebb].first_inst.wrap(), } } + + /// Split the EBB containing `...
1
140
0
54a4b9b0d79a90d9f53adfa503f8682e7770de4d
Jakob Stoklund Olesen
2016-10-14T17:09:57
Add Cursor::insert_inst(). Insert an instruction at thecurrent cursor position.
diff --git a/cranelift/src/libcretonne/ir/layout.rs b/cranelift/src/libcretonne/ir/layout.rs index 1b7838610..48943ffc1 100644 --- a/cranelift/src/libcretonne/ir/layout.rs +++ b/cranelift/src/libcretonne/ir/layout.rs @@ -511,6 +511,24 @@ impl<'a> Cursor<'a> { } } } + + /// Insert an instru...
1
18
0
6f68673e8a65702daab5611934a0c2513335edc7
Jakob Stoklund Olesen
2016-10-14T17:09:57
Add Cursor::insert_inst(). Insert an instruction at thecurrent cursor position.
diff --git a/src/libcretonne/ir/layout.rs b/src/libcretonne/ir/layout.rs index 1b7838610..48943ffc1 100644 --- a/src/libcretonne/ir/layout.rs +++ b/src/libcretonne/ir/layout.rs @@ -511,6 +511,24 @@ impl<'a> Cursor<'a> { } } } + + /// Insert an instruction at the current position. + /// ...
1
18
0
177ac85db53b1f4e5ecc58c23fd3c346ef02e0fb
Jakob Stoklund Olesen
2016-10-13T21:36:34
Add a LAyout Cursor data structure. A layout cursor can be used instead of an iterator to keep track of a position in a basic block *and* permitting instructions to be manipulated.
diff --git a/cranelift/src/libcretonne/ir/layout.rs b/cranelift/src/libcretonne/ir/layout.rs index a872efa5d..1b7838610 100644 --- a/cranelift/src/libcretonne/ir/layout.rs +++ b/cranelift/src/libcretonne/ir/layout.rs @@ -250,9 +250,273 @@ impl<'a> Iterator for Insts<'a> { } } + +/// Layout Cursor. +/// +/// A `...
2
319
2
d650d30b882a051287dadcc88e1211594a14ded8
Jakob Stoklund Olesen
2016-10-13T21:36:34
Add a LAyout Cursor data structure. A layout cursor can be used instead of an iterator to keep track of a position in a basic block *and* permitting instructions to be manipulated.
diff --git a/src/libcretonne/ir/layout.rs b/src/libcretonne/ir/layout.rs index a872efa5d..1b7838610 100644 --- a/src/libcretonne/ir/layout.rs +++ b/src/libcretonne/ir/layout.rs @@ -250,9 +250,273 @@ impl<'a> Iterator for Insts<'a> { } } + +/// Layout Cursor. +/// +/// A `Cursor` represents a position in a funct...
2
319
2
75406ad5bea1560e8fcf32f760e7ec2581f54905
Jakob Stoklund Olesen
2016-10-12T20:35:18
Move signatures into new ir::extfunc module. This new module will gain more data types dealing with external function calls.
diff --git a/cranelift/src/libcretonne/ir/extfunc.rs b/cranelift/src/libcretonne/ir/extfunc.rs new file mode 100644 index 000000000..78b723398 --- /dev/null +++ b/cranelift/src/libcretonne/ir/extfunc.rs @@ -0,0 +1,135 @@ +//! External function calls. +//! +//! To a Cretonne function, all functions are "external". Direc...
4
142
131
b42d85ae24a12f420d60655fb40284b07a9f0ac0
Jakob Stoklund Olesen
2016-10-12T20:35:18
Move signatures into new ir::extfunc module. This new module will gain more data types dealing with external function calls.
diff --git a/src/libcretonne/ir/extfunc.rs b/src/libcretonne/ir/extfunc.rs new file mode 100644 index 000000000..78b723398 --- /dev/null +++ b/src/libcretonne/ir/extfunc.rs @@ -0,0 +1,135 @@ +//! External function calls. +//! +//! To a Cretonne function, all functions are "external". Directly called functions must be +...
4
142
131
ce0da25ce02db5eba0bee212dcc21ebfab3d5139
Jakob Stoklund Olesen
2016-09-22T00:21:13
Write out encoding annotations on instructions. All instructions with associated encodings are now annotated with encoding information in a column before the code. When write_function() is givan a TargetIsa reference, the annotations use ISA-specific names. Otherwise everything is numeric.
diff --git a/cranelift/src/libcretonne/ir/function.rs b/cranelift/src/libcretonne/ir/function.rs index 3ff5aea00..844101bf9 100644 --- a/cranelift/src/libcretonne/ir/function.rs +++ b/cranelift/src/libcretonne/ir/function.rs @@ -69,12 +69,12 @@ impl Function { impl Display for Function { fn fmt(&self, fmt: &mut...
3
34
9
6a71613d9283f4b93fcff3412d03a127a50b7903
Jakob Stoklund Olesen
2016-09-22T00:21:13
Write out encoding annotations on instructions. All instructions with associated encodings are now annotated with encoding information in a column before the code. When write_function() is givan a TargetIsa reference, the annotations use ISA-specific names. Otherwise everything is numeric.
diff --git a/src/libcretonne/ir/function.rs b/src/libcretonne/ir/function.rs index 3ff5aea00..844101bf9 100644 --- a/src/libcretonne/ir/function.rs +++ b/src/libcretonne/ir/function.rs @@ -69,12 +69,12 @@ impl Function { impl Display for Function { fn fmt(&self, fmt: &mut Formatter) -> fmt::Result { - wr...
3
34
9
4e09b48dd48ea119ab15542f571566db79dee389
Jakob Stoklund Olesen
2016-09-21T23:53:03
Expose Vec::get() in EntityMap.
diff --git a/cranelift/src/libcretonne/entity_map.rs b/cranelift/src/libcretonne/entity_map.rs index 74c3cf5c4..ba2075370 100644 --- a/cranelift/src/libcretonne/entity_map.rs +++ b/cranelift/src/libcretonne/entity_map.rs @@ -70,6 +70,11 @@ impl<K, V> EntityMap<K, V> k.index() < self.elems.len() } + /...
1
5
0
1c4eb44ef767ee3dc6c4a4644d5dd8cc38e46caf
Jakob Stoklund Olesen
2016-09-21T23:53:03
Expose Vec::get() in EntityMap.
diff --git a/src/libcretonne/entity_map.rs b/src/libcretonne/entity_map.rs index 74c3cf5c4..ba2075370 100644 --- a/src/libcretonne/entity_map.rs +++ b/src/libcretonne/entity_map.rs @@ -70,6 +70,11 @@ impl<K, V> EntityMap<K, V> k.index() < self.elems.len() } + /// Get the element at `k` if it exists. ...
1
5
0
16dba4d35bcecc181ad3b0c401ae30fc9267bff4
Jakob Stoklund Olesen
2016-09-21T19:12:11
Pass flags and target ISAs to filetests. Add a `needs_isa()` method to the SubTest trait, and pass a TargetIsa trait object to those sub-tests that request it. When multiple sub-tests and ISAs are specified, test the cross product. If a sub-test requires an ISA, but none are specified, fail the test. In the future, ...
diff --git a/cranelift/src/libcretonne/isa/mod.rs b/cranelift/src/libcretonne/isa/mod.rs index fbde0208e..67d5a91c2 100644 --- a/cranelift/src/libcretonne/isa/mod.rs +++ b/cranelift/src/libcretonne/isa/mod.rs @@ -91,6 +91,9 @@ pub trait TargetIsa { /// Get the name of this ISA. fn name(&self) -> &'static str;...
5
77
6
7587a51bd7c2e842c752adebd88c355b84149366
Jakob Stoklund Olesen
2016-09-21T19:12:11
Pass flags and target ISAs to filetests. Add a `needs_isa()` method to the SubTest trait, and pass a TargetIsa trait object to those sub-tests that request it. When multiple sub-tests and ISAs are specified, test the cross product. If a sub-test requires an ISA, but none are specified, fail the test. In the future, ...
diff --git a/src/libcretonne/isa/mod.rs b/src/libcretonne/isa/mod.rs index fbde0208e..67d5a91c2 100644 --- a/src/libcretonne/isa/mod.rs +++ b/src/libcretonne/isa/mod.rs @@ -91,6 +91,9 @@ pub trait TargetIsa { /// Get the name of this ISA. fn name(&self) -> &'static str; + /// Get the ISA-independent flag...
5
77
6
e4a8932962c177ff96b8cc24b1fd9ec5d47d5a0c
Jakob Stoklund Olesen
2016-09-20T20:38:36
Parse ISA specifications between test commands and functions. Some tests are only applicable to specific ISAs. This can be indicated with an ISA specification: test legalizer isa riscv function foo() { .... } The ISA specifications have the same format as the test lines: The name of the ISA f...
diff --git a/cranelift/src/libcretonne/isa/mod.rs b/cranelift/src/libcretonne/isa/mod.rs index a43b1a5cb..fbde0208e 100644 --- a/cranelift/src/libcretonne/isa/mod.rs +++ b/cranelift/src/libcretonne/isa/mod.rs @@ -88,6 +88,9 @@ impl settings::Configurable for Builder { } pub trait TargetIsa { + /// Get the name o...
6
154
3
36b143df995bc5ef27720b0ef70a053f5b623ddb
Jakob Stoklund Olesen
2016-09-20T20:38:36
Parse ISA specifications between test commands and functions. Some tests are only applicable to specific ISAs. This can be indicated with an ISA specification: test legalizer isa riscv function foo() { .... } The ISA specifications have the same format as the test lines: The name of the ISA f...
diff --git a/src/libcretonne/isa/mod.rs b/src/libcretonne/isa/mod.rs index a43b1a5cb..fbde0208e 100644 --- a/src/libcretonne/isa/mod.rs +++ b/src/libcretonne/isa/mod.rs @@ -88,6 +88,9 @@ impl settings::Configurable for Builder { } pub trait TargetIsa { + /// Get the name of this ISA. + fn name(&self) -> &'sta...
6
154
3
a078f6a6b0b9a9821d149388284b6ffec9baa3eb
Jakob Stoklund Olesen
2016-09-20T20:20:33
Share split_entity_name between lexer and sourcemap. There's only one way of parsing entity names correctly.
diff --git a/cranelift/src/libreader/lexer.rs b/cranelift/src/libreader/lexer.rs index c57b8290c..3454225dc 100644 --- a/cranelift/src/libreader/lexer.rs +++ b/cranelift/src/libreader/lexer.rs @@ -6,6 +6,7 @@ // ====--------------------------------------------------------------------------------------====// use std...
2
63
71
26332f6f918230a48fd1ff6155c38ab46d400afc
Jakob Stoklund Olesen
2016-09-20T20:20:33
Share split_entity_name between lexer and sourcemap. There's only one way of parsing entity names correctly.
diff --git a/src/libreader/lexer.rs b/src/libreader/lexer.rs index c57b8290c..3454225dc 100644 --- a/src/libreader/lexer.rs +++ b/src/libreader/lexer.rs @@ -6,6 +6,7 @@ // ====--------------------------------------------------------------------------------------====// use std::str::CharIndices; +use std::u16; use ...
2
63
71
de35e715fa83097a4d9b5cd3fce606cbd4a08e09
Jakob Stoklund Olesen
2016-09-20T17:49:30
Add a stub implementation of the legalizer. This basic version only fills in the encoding of already-legal instructions. It doesn't have any way of transforming the illegal instructions yet.
diff --git a/cranelift/src/libcretonne/legalizer.rs b/cranelift/src/libcretonne/legalizer.rs new file mode 100644 index 000000000..3358f77bb --- /dev/null +++ b/cranelift/src/libcretonne/legalizer.rs @@ -0,0 +1,54 @@ +//! Legalize instructions. +//! +//! A legal instruction is one that can be mapped directly to a machi...
2
55
0
fab16941c8640120fbbdd8d1bd85681680ee99d0
Jakob Stoklund Olesen
2016-09-20T17:49:30
Add a stub implementation of the legalizer. This basic version only fills in the encoding of already-legal instructions. It doesn't have any way of transforming the illegal instructions yet.
diff --git a/src/libcretonne/legalizer.rs b/src/libcretonne/legalizer.rs new file mode 100644 index 000000000..3358f77bb --- /dev/null +++ b/src/libcretonne/legalizer.rs @@ -0,0 +1,54 @@ +//! Legalize instructions. +//! +//! A legal instruction is one that can be mapped directly to a machine code instruction for the +/...
2
55
0
ebadbdbe7e8f3f35327a9cd26c16473d1f5bd7a0
Jakob Stoklund Olesen
2016-09-20T17:17:16
Store instruction encodings in Function. This is a side-table of ISA-dependent information that will initially be filled out by the legalizer.
diff --git a/cranelift/src/libcretonne/ir/function.rs b/cranelift/src/libcretonne/ir/function.rs index ac6c96286..3ff5aea00 100644 --- a/cranelift/src/libcretonne/ir/function.rs +++ b/cranelift/src/libcretonne/ir/function.rs @@ -3,10 +3,11 @@ //! The `Function` struct defined in this module owns all of its extended ba...
1
8
2
1d0ab91136bfb08f81499f9d8ce6e90c3ddbef32
Jakob Stoklund Olesen
2016-09-20T17:17:16
Store instruction encodings in Function. This is a side-table of ISA-dependent information that will initially be filled out by the legalizer.
diff --git a/src/libcretonne/ir/function.rs b/src/libcretonne/ir/function.rs index ac6c96286..3ff5aea00 100644 --- a/src/libcretonne/ir/function.rs +++ b/src/libcretonne/ir/function.rs @@ -3,10 +3,11 @@ //! The `Function` struct defined in this module owns all of its extended basic blocks and //! instructions. -use...
1
8
2
7417f884b3a90dd3dc8e9ad6283fd0f9306f9a00
Jakob Stoklund Olesen
2016-09-20T16:48:00
Add clear, is_empty, and resize methods to EntityMap. These are simply forwards from the underlying Vec.
diff --git a/cranelift/src/libcretonne/entity_map.rs b/cranelift/src/libcretonne/entity_map.rs index 2a76e3cce..74c3cf5c4 100644 --- a/cranelift/src/libcretonne/entity_map.rs +++ b/cranelift/src/libcretonne/entity_map.rs @@ -70,6 +70,16 @@ impl<K, V> EntityMap<K, V> k.index() < self.elems.len() } + /...
1
16
1
57b6967ddd1c674674b75fd96b7e354caa7cb733
Jakob Stoklund Olesen
2016-09-20T16:48:00
Add clear, is_empty, and resize methods to EntityMap. These are simply forwards from the underlying Vec.
diff --git a/src/libcretonne/entity_map.rs b/src/libcretonne/entity_map.rs index 2a76e3cce..74c3cf5c4 100644 --- a/src/libcretonne/entity_map.rs +++ b/src/libcretonne/entity_map.rs @@ -70,6 +70,16 @@ impl<K, V> EntityMap<K, V> k.index() < self.elems.len() } + /// Is this map completely empty? + pu...
1
16
1
6fb566fa85cf625654746b40368f96c9ba7a3f8e
Jakob Stoklund Olesen
2016-09-19T20:45:22
Add a TargetIsa::display_enc() method. The interpretation of an encoding depends on the target ISA, and so does the proper printing of the encoding.
diff --git a/cranelift/src/libcretonne/isa/encoding.rs b/cranelift/src/libcretonne/isa/encoding.rs index 1b26e2bab..0bb1f6cc6 100644 --- a/cranelift/src/libcretonne/isa/encoding.rs +++ b/cranelift/src/libcretonne/isa/encoding.rs @@ -1,5 +1,7 @@ //! The `Encoding` struct. +use std::fmt; + /// Bits needed to encode a...
3
54
1
43aa6f66d9f714af739dc378b0fd5e87b44e834c
Jakob Stoklund Olesen
2016-09-19T20:45:22
Add a TargetIsa::display_enc() method. The interpretation of an encoding depends on the target ISA, and so does the proper printing of the encoding.
diff --git a/src/libcretonne/isa/encoding.rs b/src/libcretonne/isa/encoding.rs index 1b26e2bab..0bb1f6cc6 100644 --- a/src/libcretonne/isa/encoding.rs +++ b/src/libcretonne/isa/encoding.rs @@ -1,5 +1,7 @@ //! The `Encoding` struct. +use std::fmt; + /// Bits needed to encode an instruction as binary machine code. /...
3
54
1
fb1bc5d09683a447dd26e4b3ad12db9a9a7a6844
Jakob Stoklund Olesen
2016-09-19T20:07:58
Move 'Encoding' into its own module.
diff --git a/cranelift/src/libcretonne/isa/encoding.rs b/cranelift/src/libcretonne/isa/encoding.rs new file mode 100644 index 000000000..1b26e2bab --- /dev/null +++ b/cranelift/src/libcretonne/isa/encoding.rs @@ -0,0 +1,33 @@ +//! The `Encoding` struct. + +/// Bits needed to encode an instruction as binary machine code...
2
38
35
59c404ed298bad14980b503fc385e47f0e408f77
Jakob Stoklund Olesen
2016-09-19T20:07:58
Move 'Encoding' into its own module.
diff --git a/src/libcretonne/isa/encoding.rs b/src/libcretonne/isa/encoding.rs new file mode 100644 index 000000000..1b26e2bab --- /dev/null +++ b/src/libcretonne/isa/encoding.rs @@ -0,0 +1,33 @@ +//! The `Encoding` struct. + +/// Bits needed to encode an instruction as binary machine code. +/// +/// The encoding consi...
2
38
35
b5ffd3af9253f6b1e279954f74076474144b9dee
Jakob Stoklund Olesen
2016-09-19T20:00:16
Rename 'encoding' modules to 'enc_tables'. These modules contain encoding tables, not the 'Encoding' struct.
diff --git a/cranelift/src/libcretonne/isa/encoding.rs b/cranelift/src/libcretonne/isa/enc_tables.rs similarity index 100% rename from cranelift/src/libcretonne/isa/encoding.rs rename to cranelift/src/libcretonne/isa/enc_tables.rs diff --git a/cranelift/src/libcretonne/isa/mod.rs b/cranelift/src/libcretonne/isa/mod.rs ...
4
13
14
ce6a463267526b26094cc0f237991fd655cfcdf6
Jakob Stoklund Olesen
2016-09-19T20:00:16
Rename 'encoding' modules to 'enc_tables'. These modules contain encoding tables, not the 'Encoding' struct.
diff --git a/src/libcretonne/isa/encoding.rs b/src/libcretonne/isa/enc_tables.rs similarity index 100% rename from src/libcretonne/isa/encoding.rs rename to src/libcretonne/isa/enc_tables.rs diff --git a/src/libcretonne/isa/mod.rs b/src/libcretonne/isa/mod.rs index 6eaae9fc6..74e1590fe 100644 --- a/src/libcretonne/isa/...
4
13
14
047bf5ab28c934869f3fdf1cf2808e342c56c799
Jakob Stoklund Olesen
2016-09-19T18:42:56
Remove the inst_locs vector in the parser. Use the source map to track instruction locations instead. The rewrite methods now take an AnyEntity argument as the location to use for errors. This means that bad EBB references in jump tables are now reported correctly.
diff --git a/cranelift/src/libreader/error.rs b/cranelift/src/libreader/error.rs index edc6e4064..cf8bd12f0 100644 --- a/cranelift/src/libreader/error.rs +++ b/cranelift/src/libreader/error.rs @@ -6,7 +6,7 @@ use std::fmt; use std::result; /// The location of a `Token` or `Error`. -#[derive(Debug, Clone, Copy, Part...
3
61
59