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
c3b7fc9a9c4dc0162293bdda514b1407cba2fba3
Jakob Stoklund Olesen
2016-08-12T23:41:48
Move ir::Function into a sub-module. Keep the top-level ir module free of implementation details that are inadvertently exposed to sub-modules.
diff --git a/src/libcretonne/ir/function.rs b/src/libcretonne/ir/function.rs new file mode 100644 index 000000000..2f8344d80 --- /dev/null +++ b/src/libcretonne/ir/function.rs @@ -0,0 +1,64 @@ +//! Intermediate representation of a function. +//! +//! The `Function` struct defined in this module owns all of its extended...
2
66
58
f4258ae293bc2ce63ba21ede4d648ff855b3b090
Jakob Stoklund Olesen
2016-08-12T23:34:18
Use an EntityMap for stack slots. Delete the StackSlots iterator and move the remaining StackSlotData into its own module.
diff --git a/cranelift/src/libcretonne/ir/mod.rs b/cranelift/src/libcretonne/ir/mod.rs index 30fb4d932..806466a90 100644 --- a/cranelift/src/libcretonne/ir/mod.rs +++ b/cranelift/src/libcretonne/ir/mod.rs @@ -1,10 +1,11 @@ //! Representation of Cretonne IL functions. -pub mod entities; pub mod types; +pub mod entit...
4
63
108
09b7420ca9fff652d5db2f70664bb8b83c87a6e2
Jakob Stoklund Olesen
2016-08-12T23:34:18
Use an EntityMap for stack slots. Delete the StackSlots iterator and move the remaining StackSlotData into its own module.
diff --git a/src/libcretonne/ir/mod.rs b/src/libcretonne/ir/mod.rs index 30fb4d932..806466a90 100644 --- a/src/libcretonne/ir/mod.rs +++ b/src/libcretonne/ir/mod.rs @@ -1,10 +1,11 @@ //! Representation of Cretonne IL functions. -pub mod entities; pub mod types; +pub mod entities; pub mod condcodes; pub mod immedi...
4
63
108
b266c28767e8804bfc06c72db6aa8462f0da7d6b
Jakob Stoklund Olesen
2016-08-12T23:11:38
Re-export common types in the cretonne::ir module. Clients should not have to navigate the ir sub-modules to find commonly used types.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 022c3372e..8397ca516 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -22,8 +22,7 @@ //! Here Ebb1 and Ebb2 would each have a single predecessor denoted as (Ebb0, `brz vx, Ebb1`) //! and (Ebb0...
15
36
36
40e0989b8b822b3e3d22d41171e84b49dc4d0bfd
Jakob Stoklund Olesen
2016-08-12T23:11:38
Re-export common types in the cretonne::ir module. Clients should not have to navigate the ir sub-modules to find commonly used types.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 022c3372e..8397ca516 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -22,8 +22,7 @@ //! Here Ebb1 and Ebb2 would each have a single predecessor denoted as (Ebb0, `brz vx, Ebb1`) //! and (Ebb0, `jmp Ebb2`) respectively. -use ir::F...
15
36
36
9d6e30df92933e39e5a4ca87c7d3471202e0b127
Jakob Stoklund Olesen
2016-08-12T18:03:28
Remove tests/lib.rs to avoid running tests twice. The 'cargo test' command simply compiles each 'tests/*.rs' and runs the enclosed tests. The 'lib.rs' source would get run as an individual test.
diff --git a/cranelift/src/tools/tests/lib.rs b/cranelift/src/tools/tests/lib.rs deleted file mode 100644 index fcd253526..000000000 --- a/cranelift/src/tools/tests/lib.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod cfg_traversal; -pub mod dominator_tree;
1
0
2
9e87bffa82d28273cbc4f4827fe9f110f68d1d54
Jakob Stoklund Olesen
2016-08-12T18:03:28
Remove tests/lib.rs to avoid running tests twice. The 'cargo test' command simply compiles each 'tests/*.rs' and runs the enclosed tests. The 'lib.rs' source would get run as an individual test.
diff --git a/src/tools/tests/lib.rs b/src/tools/tests/lib.rs deleted file mode 100644 index fcd253526..000000000 --- a/src/tools/tests/lib.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod cfg_traversal; -pub mod dominator_tree;
1
0
2
1ae9a37796488b3c1c200e0cf679f81667ead35f
Jakob Stoklund Olesen
2016-08-10T19:07:32
Document ISA builder.
diff --git a/cranelift/src/libcretonne/isa/mod.rs b/cranelift/src/libcretonne/isa/mod.rs index cd9749e6e..577f6e400 100644 --- a/cranelift/src/libcretonne/isa/mod.rs +++ b/cranelift/src/libcretonne/isa/mod.rs @@ -1,10 +1,30 @@ //! Instruction Set Architectures. //! //! The `isa` module provides a `TargetIsa` trait w...
1
23
3
8c48739afd35c4c36dd3fb266daa09b496a39e0a
Jakob Stoklund Olesen
2016-08-10T19:07:32
Document ISA builder.
diff --git a/src/libcretonne/isa/mod.rs b/src/libcretonne/isa/mod.rs index cd9749e6e..577f6e400 100644 --- a/src/libcretonne/isa/mod.rs +++ b/src/libcretonne/isa/mod.rs @@ -1,10 +1,30 @@ //! Instruction Set Architectures. //! //! The `isa` module provides a `TargetIsa` trait which provides the behavior specializatio...
1
23
3
24ec62d030cd384130411c1e280888e82a7adff7
Jakob Stoklund Olesen
2016-08-09T18:28:51
Move simple_hash into its own module.
diff --git a/cranelift/src/libcretonne/ir/instructions.rs b/cranelift/src/libcretonne/ir/instructions.rs index 4087e246d..9d5c59eb7 100644 --- a/cranelift/src/libcretonne/ir/instructions.rs +++ b/cranelift/src/libcretonne/ir/instructions.rs @@ -54,16 +54,6 @@ impl Opcode { } } -// A primitive hash function for ...
3
24
10
d152719d93fffa1656a6e273b12e99f828fa0d44
Jakob Stoklund Olesen
2016-08-09T18:28:51
Move simple_hash into its own module.
diff --git a/src/libcretonne/ir/instructions.rs b/src/libcretonne/ir/instructions.rs index 4087e246d..9d5c59eb7 100644 --- a/src/libcretonne/ir/instructions.rs +++ b/src/libcretonne/ir/instructions.rs @@ -54,16 +54,6 @@ impl Opcode { } } -// A primitive hash function for matching opcodes. -// Must match `meta/c...
3
24
10
c679a2e746b836a17ea9a383247ebcbfd3fcb6b7
Jakob Stoklund Olesen
2016-08-05T16:55:53
Scaffold implementation of the TargetIsa trait. More to come here.
diff --git a/cranelift/src/libcretonne/isa/mod.rs b/cranelift/src/libcretonne/isa/mod.rs index e2f48e7bb..cd9749e6e 100644 --- a/cranelift/src/libcretonne/isa/mod.rs +++ b/cranelift/src/libcretonne/isa/mod.rs @@ -1,6 +1,44 @@ //! Instruction Set Architectures. //! -//! The sub-modules of this `isa` module provide def...
1
40
2
6b6939128967de36097838ac3e954ff38104037d
Jakob Stoklund Olesen
2016-08-05T16:55:53
Scaffold implementation of the TargetIsa trait. More to come here.
diff --git a/src/libcretonne/isa/mod.rs b/src/libcretonne/isa/mod.rs index e2f48e7bb..cd9749e6e 100644 --- a/src/libcretonne/isa/mod.rs +++ b/src/libcretonne/isa/mod.rs @@ -1,6 +1,44 @@ //! Instruction Set Architectures. //! -//! The sub-modules of this `isa` module provide definitions for the instruction sets that C...
1
40
2
6d786113db9125ca2645af5856f95a717b470f48
Jakob Stoklund Olesen
2016-08-04T18:39:25
Add an empty isa/riscv module scaffold. Targeted ISAs will be defined as sub-modules of isa.
diff --git a/cranelift/src/libcretonne/isa/mod.rs b/cranelift/src/libcretonne/isa/mod.rs new file mode 100644 index 000000000..e2f48e7bb --- /dev/null +++ b/cranelift/src/libcretonne/isa/mod.rs @@ -0,0 +1,6 @@ +//! Instruction Set Architectures. +//! +//! The sub-modules of this `isa` module provide definitions for the...
3
8
0
c47c52401782a6c17b61a98b44a7cd0f7bc85c97
Jakob Stoklund Olesen
2016-08-04T18:39:25
Add an empty isa/riscv module scaffold. Targeted ISAs will be defined as sub-modules of isa.
diff --git a/src/libcretonne/isa/mod.rs b/src/libcretonne/isa/mod.rs new file mode 100644 index 000000000..e2f48e7bb --- /dev/null +++ b/src/libcretonne/isa/mod.rs @@ -0,0 +1,6 @@ +//! Instruction Set Architectures. +//! +//! The sub-modules of this `isa` module provide definitions for the instruction sets that Cretonn...
3
8
0
82a85961ff68bd86b7ff98c948b6702f095350be
Jakob Stoklund Olesen
2016-08-01T21:45:59
Add PrimaryEntityData marker trait. Require this trait on the value type stored in an EntityMap to 'unlock' the methods intended for primary entity maps that are allowed to create references with the 'push method. This prevents accidentally depending on these methods in secondary maps.
diff --git a/cranelift/src/libcretonne/entity_map.rs b/cranelift/src/libcretonne/entity_map.rs index a0f4f3fa6..91ff7505a 100644 --- a/cranelift/src/libcretonne/entity_map.rs +++ b/cranelift/src/libcretonne/entity_map.rs @@ -2,7 +2,13 @@ //! //! This module defines an `EntityRef` trait that should be implemented by r...
3
42
19
f5008567c9a479423a1fce1801fdce268e013b2f
Jakob Stoklund Olesen
2016-08-01T21:45:59
Add PrimaryEntityData marker trait. Require this trait on the value type stored in an EntityMap to 'unlock' the methods intended for primary entity maps that are allowed to create references with the 'push method. This prevents accidentally depending on these methods in secondary maps.
diff --git a/src/libcretonne/entity_map.rs b/src/libcretonne/entity_map.rs index a0f4f3fa6..91ff7505a 100644 --- a/src/libcretonne/entity_map.rs +++ b/src/libcretonne/entity_map.rs @@ -2,7 +2,13 @@ //! //! This module defines an `EntityRef` trait that should be implemented by reference types wrapping //! a small int...
3
42
19
283f3ea48e7eb8a981744c9e793559418420cdad
Morgan Phillips
2016-08-02T01:04:25
Remove uses of EntityMap::len.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 28a39861e..022c3372e 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -25,7 +25,7 @@ use ir::Function; use ir::entities::{Inst, Ebb}; use ir::instructions::BranchInfo; -use entity_map::Entity...
4
57
78
80abf8b1f00761debb41f0f6a2d0914c98931080
Morgan Phillips
2016-08-02T01:04:25
Remove uses of EntityMap::len.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 28a39861e..022c3372e 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -25,7 +25,7 @@ use ir::Function; use ir::entities::{Inst, Ebb}; use ir::instructions::BranchInfo; -use entity_map::EntityMap; +use entity_map::{EntityMap, Keys};...
4
57
78
11f65fff202dbbdd2a78b6440099e24f5bd98b58
Jakob Stoklund Olesen
2016-08-01T22:14:32
Remove the cfg::predecessors_iter() method and iterator. This iterator enumerates all EBB references whether they are in the layout or not. That is usually not what is needed when working with the CFG. It is better to iterate over EBB referrences in layout order, or in reverse post-order and then call the get_predece...
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 28a39861e..30f16b5df 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -142,34 +142,6 @@ impl ControlFlowGraph { pub fn len(&self) -> usize { self.data.len() } - - pub fn pr...
1
3
30
2c1e80b0e0654840d9266d6838413fc556d5918c
Jakob Stoklund Olesen
2016-08-01T22:14:32
Remove the cfg::predecessors_iter() method and iterator. This iterator enumerates all EBB references whether they are in the layout or not. That is usually not what is needed when working with the CFG. It is better to iterate over EBB referrences in layout order, or in reverse post-order and then call the get_predece...
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 28a39861e..30f16b5df 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -142,34 +142,6 @@ impl ControlFlowGraph { pub fn len(&self) -> usize { self.data.len() } - - pub fn predecessors_iter(&self) -> CFGPredecessor...
1
3
30
bf24ae229cec2889fc1d26ce0195947f030ba3e5
Jakob Stoklund Olesen
2016-08-01T22:03:56
Print CFG edges from func.layout instead of cfg.predecessors_iter. EBBs not in the layout should never be printed as part of the CFG.
diff --git a/cranelift/src/tools/print_cfg.rs b/cranelift/src/tools/print_cfg.rs index 9a08c0287..dd1aa3de1 100644 --- a/cranelift/src/tools/print_cfg.rs +++ b/cranelift/src/tools/print_cfg.rs @@ -41,8 +41,8 @@ impl<T: Write> CFGPrinter<T> { self.header(func); self.push_indent(); self.ebb_sub...
1
5
5
02c1bb8f2c44a39997b426ef5dda67bd2e497658
Jakob Stoklund Olesen
2016-08-01T22:03:56
Print CFG edges from func.layout instead of cfg.predecessors_iter. EBBs not in the layout should never be printed as part of the CFG.
diff --git a/src/tools/print_cfg.rs b/src/tools/print_cfg.rs index 9a08c0287..dd1aa3de1 100644 --- a/src/tools/print_cfg.rs +++ b/src/tools/print_cfg.rs @@ -41,8 +41,8 @@ impl<T: Write> CFGPrinter<T> { self.header(func); self.push_indent(); self.ebb_subgraphs(func); - let cfg = Control...
1
5
5
e22efd274847062258c528917cadc55e4886747c
Morgan Phillips
2016-08-01T22:00:08
Improve the structure and comments of the module.
diff --git a/cranelift/src/libcretonne/dominator_tree.rs b/cranelift/src/libcretonne/dominator_tree.rs index 8dcc4e289..c58726a1a 100644 --- a/cranelift/src/libcretonne/dominator_tree.rs +++ b/cranelift/src/libcretonne/dominator_tree.rs @@ -10,25 +10,25 @@ pub struct DominatorTree { impl DominatorTree { pub fn ...
1
27
12
e9cfcf4f780a5a25d41bc3f51a7fe9d7f3eca8bf
Morgan Phillips
2016-08-01T22:00:08
Improve the structure and comments of the module.
diff --git a/src/libcretonne/dominator_tree.rs b/src/libcretonne/dominator_tree.rs index 8dcc4e289..c58726a1a 100644 --- a/src/libcretonne/dominator_tree.rs +++ b/src/libcretonne/dominator_tree.rs @@ -10,25 +10,25 @@ pub struct DominatorTree { impl DominatorTree { pub fn new(cfg: &ControlFlowGraph) -> Dominator...
1
27
12
f2e9c88b4500d9eeb21120da1609d821b4360d84
Morgan Phillips
2016-08-01T19:15:08
Remove println\!
diff --git a/cranelift/src/libcretonne/dominator_tree.rs b/cranelift/src/libcretonne/dominator_tree.rs index e4569ea11..8dcc4e289 100644 --- a/cranelift/src/libcretonne/dominator_tree.rs +++ b/cranelift/src/libcretonne/dominator_tree.rs @@ -65,7 +65,6 @@ impl DominatorTree { } fn intersect(&self, ordering: ...
1
0
1
5a38ca2db72c699d2b165160ec2f2653b7532ba9
Morgan Phillips
2016-08-01T19:15:08
Remove println\!
diff --git a/src/libcretonne/dominator_tree.rs b/src/libcretonne/dominator_tree.rs index e4569ea11..8dcc4e289 100644 --- a/src/libcretonne/dominator_tree.rs +++ b/src/libcretonne/dominator_tree.rs @@ -65,7 +65,6 @@ impl DominatorTree { } fn intersect(&self, ordering: &EntityMap<Ebb, usize>, first: Ebb, seco...
1
0
1
967a7c64d4468273f36a3130dbf5e34481e65db9
Morgan Phillips
2016-08-01T04:40:11
Add a dominator tree implementation.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 25b5f2409..28a39861e 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -89,7 +89,7 @@ impl ControlFlowGraph { self.data[to].predecessors.push(from); } - fn get_predecessors(&se...
5
201
2
19a47d57b3b27860735644e6c98637c14232a6db
Morgan Phillips
2016-08-01T04:40:11
Add a dominator tree implementation.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 25b5f2409..28a39861e 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -89,7 +89,7 @@ impl ControlFlowGraph { self.data[to].predecessors.push(from); } - fn get_predecessors(&self, ebb: Ebb) -> &Vec<BasicBlock> { + ...
5
201
2
a8beb542a5ef39ab9989c846e251efa68eedcf67
Morgan Phillips
2016-08-01T04:31:18
Clean up the CFG representation.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index ff45b59ae..25b5f2409 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -26,13 +26,13 @@ use ir::Function; use ir::entities::{Inst, Ebb}; use ir::instructions::BranchInfo; use entity_map::Entit...
2
15
30
0ce01c1b8dffd46691284ba1f4170da3d5296c8d
Morgan Phillips
2016-08-01T04:31:18
Clean up the CFG representation.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index ff45b59ae..25b5f2409 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -26,13 +26,13 @@ use ir::Function; use ir::entities::{Inst, Ebb}; use ir::instructions::BranchInfo; use entity_map::EntityMap; -use std::collections::{HashSet, B...
2
15
30
dae349371fd94ac165417d3a1adaa1df5d107a4a
Jakob Stoklund Olesen
2016-07-29T22:59:09
Add EntityMap::with_capacity. Create a secondary entity map with space reserved for a known range of entity references. Add dfg.num_ebbs() and dfg.num_insts() methods to provide capacities.
diff --git a/cranelift/src/libcretonne/entity_map.rs b/cranelift/src/libcretonne/entity_map.rs index 9ce39bec1..a0f4f3fa6 100644 --- a/cranelift/src/libcretonne/entity_map.rs +++ b/cranelift/src/libcretonne/entity_map.rs @@ -102,6 +102,21 @@ impl<K, V> EntityMap<K, V> where K: EntityRef, V: Clone + Defa...
2
31
0
bbdae39cb96e45c922e5487721786a9806155517
Jakob Stoklund Olesen
2016-07-29T22:59:09
Add EntityMap::with_capacity. Create a secondary entity map with space reserved for a known range of entity references. Add dfg.num_ebbs() and dfg.num_insts() methods to provide capacities.
diff --git a/src/libcretonne/entity_map.rs b/src/libcretonne/entity_map.rs index 9ce39bec1..a0f4f3fa6 100644 --- a/src/libcretonne/entity_map.rs +++ b/src/libcretonne/entity_map.rs @@ -102,6 +102,21 @@ impl<K, V> EntityMap<K, V> where K: EntityRef, V: Clone + Default { + /// Create a new secondary `...
2
31
0
2f07a3b6752014d4128bc9159fe2260ec334c1d2
Morgan Phillips
2016-07-29T00:51:50
Remove innacurate comments.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index f9df5e299..ff45b59ae 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -140,8 +140,6 @@ impl ControlFlowGraph { } } } else if !black.contains(&n...
1
0
2
a9748dff0276f653b6ad6af334ff91a0602aceb6
Morgan Phillips
2016-07-29T00:51:50
Remove innacurate comments.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index f9df5e299..ff45b59ae 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -140,8 +140,6 @@ impl ControlFlowGraph { } } } else if !black.contains(&node) { - // This is a gra...
1
0
2
7936444e1f7ff2d7ed91c47991642c65ce8bf0ac
Morgan Phillips
2016-07-29T00:49:25
Simplify the reverse_postorder_ebbs implementation.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 5d1cbaadf..f9df5e299 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -24,9 +24,9 @@ use ir::Function; use ir::entities::{Inst, Ebb}; -use ir::instructions::InstructionData; +use ir::instruc...
2
64
100
82ff64820c06895ff498538d0777372992e2936e
Morgan Phillips
2016-07-29T00:49:25
Simplify the reverse_postorder_ebbs implementation.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 5d1cbaadf..f9df5e299 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -24,9 +24,9 @@ use ir::Function; use ir::entities::{Inst, Ebb}; -use ir::instructions::InstructionData; +use ir::instructions::BranchInfo; use entity_map::Enti...
2
64
100
1027fc747215cd6ce2bcdf373e8b2f7c8f92525e
Morgan Phillips
2016-07-27T00:13:11
Avoid cloning levels
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index bc78a3e90..5d1cbaadf 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -142,7 +142,7 @@ impl ControlFlowGraph { } /// A helper for iteratively walking a CFG in postorder. -pub struct CFGPosto...
1
4
5
e94d7c2a9991a4d9e44026be694e0efdb76e6f81
Morgan Phillips
2016-07-27T00:13:11
Avoid cloning levels
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index bc78a3e90..5d1cbaadf 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -142,7 +142,7 @@ impl ControlFlowGraph { } /// A helper for iteratively walking a CFG in postorder. -pub struct CFGPostorderWalker<'a> { +struct CFGPostorderWal...
1
4
5
b67d07e87a8e94220771fe9ba684e8d19d5aadae
Morgan Phillips
2016-07-26T19:07:18
Give the test module a more apt name.
diff --git a/cranelift/src/libcretonne/tests/cfg.rs b/cranelift/src/libcretonne/tests/cfg_traversal.rs similarity index 71% rename from cranelift/src/libcretonne/tests/cfg.rs rename to cranelift/src/libcretonne/tests/cfg_traversal.rs index 3024b8a8f..056b72dc1 100644 --- a/cranelift/src/libcretonne/tests/cfg.rs +++ b/c...
2
33
5
1cd6e35a427882f9b227722c0e3fa59b7b6a5899
Morgan Phillips
2016-07-26T19:07:18
Give the test module a more apt name.
diff --git a/src/libcretonne/tests/cfg.rs b/src/libcretonne/tests/cfg_traversal.rs similarity index 71% rename from src/libcretonne/tests/cfg.rs rename to src/libcretonne/tests/cfg_traversal.rs index 3024b8a8f..056b72dc1 100644 --- a/src/libcretonne/tests/cfg.rs +++ b/src/libcretonne/tests/cfg_traversal.rs @@ -11,11 +1...
2
33
5
a9842ff363ef016b296aebbd0b2543590f1b4c2f
Morgan Phillips
2016-07-26T09:54:42
Fix broken reverse_postorder_ebbs implementation. The previous implementation was actually a reverse preorder walk.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index d30262e4c..bc78a3e90 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -26,7 +26,7 @@ use ir::Function; use ir::entities::{Inst, Ebb}; use ir::instructions::InstructionData; use entity_map::En...
2
103
19
42b98353636c03c830ef47d9c3ed8beaf0548e97
Morgan Phillips
2016-07-26T09:54:42
Fix broken reverse_postorder_ebbs implementation. The previous implementation was actually a reverse preorder walk.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index d30262e4c..bc78a3e90 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -26,7 +26,7 @@ use ir::Function; use ir::entities::{Inst, Ebb}; use ir::instructions::InstructionData; use entity_map::EntityMap; -use std::collections::{HashSet...
2
103
19
1f0e344b24c942932364cf1af73f05cec6e1744d
Morgan Phillips
2016-07-26T01:50:50
Cargo-fmt and cleanup.
diff --git a/cranelift/src/libcretonne/Cargo.toml b/cranelift/src/libcretonne/Cargo.toml index e6158af94..cfd886391 100644 --- a/cranelift/src/libcretonne/Cargo.toml +++ b/cranelift/src/libcretonne/Cargo.toml @@ -12,4 +12,7 @@ build = "build.rs" name = "cretonne" path = "lib.rs" +[dev-dependencies] +cretonne-reader...
2
3
121
400504d3211ad2301505e6d64aea2ee690808475
Morgan Phillips
2016-07-26T01:50:50
Cargo-fmt and cleanup.
diff --git a/src/libcretonne/Cargo.toml b/src/libcretonne/Cargo.toml index e6158af94..cfd886391 100644 --- a/src/libcretonne/Cargo.toml +++ b/src/libcretonne/Cargo.toml @@ -12,4 +12,7 @@ build = "build.rs" name = "cretonne" path = "lib.rs" +[dev-dependencies] +cretonne-reader = { path = "../libreader" } + [depende...
2
3
121
d137529bd5ca7afbc3b94abdde2f338ef2c89899
Morgan Phillips
2016-07-26T01:49:39
Use cton_reader to simplify cfg traversal tests.
diff --git a/cranelift/src/libcretonne/tests/cfg.rs b/cranelift/src/libcretonne/tests/cfg.rs new file mode 100644 index 000000000..6ad024aef --- /dev/null +++ b/cranelift/src/libcretonne/tests/cfg.rs @@ -0,0 +1,85 @@ +extern crate cretonne; +extern crate cton_reader; + +use self::cton_reader::parser::Parser; +use self:...
2
86
0
63b58214f7f2526324b73a858594549047aa8117
Morgan Phillips
2016-07-26T01:49:39
Use cton_reader to simplify cfg traversal tests.
diff --git a/src/libcretonne/tests/cfg.rs b/src/libcretonne/tests/cfg.rs new file mode 100644 index 000000000..6ad024aef --- /dev/null +++ b/src/libcretonne/tests/cfg.rs @@ -0,0 +1,85 @@ +extern crate cretonne; +extern crate cton_reader; + +use self::cton_reader::parser::Parser; +use self::cretonne::ir::entities::Ebb; ...
2
86
0
26c350833a7191d587767fc38d2836dac6546b72
Morgan Phillips
2016-07-25T08:05:15
Change variable name to something more descriptive.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index c853d8183..696c364af 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -120,14 +120,14 @@ impl ControlFlowGraph { Some(eb) => eb, }; let mut seen = HashSet::new(); ...
1
4
4
bb7ecc8753d4f86d8319c724f70e5246f3d60b40
Morgan Phillips
2016-07-25T08:05:15
Change variable name to something more descriptive.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index c853d8183..696c364af 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -120,14 +120,14 @@ impl ControlFlowGraph { Some(eb) => eb, }; let mut seen = HashSet::new(); - let mut stack_a = vec![entry_bl...
1
4
4
aa730ec2c42dd9950fbaebb4af3a098cd7d550a9
Morgan Phillips
2016-07-25T07:41:34
make postorder_ebbs into actually reverse_postorder_ebbs. This is a more accurate description. Further return the ebbs in a btreemap so that the index of each Ebb (its order of visitation) is quick to lookup.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index e221f55fc..c853d8183 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -24,8 +24,9 @@ use ir::Function; use ir::entities::{Inst, Ebb}; -use ir::instructions::BranchInfo; +use ir::instructions...
1
89
23
91ced8df90ea180f2923f16b205151d22662aff5
Morgan Phillips
2016-07-25T07:41:34
make postorder_ebbs into actually reverse_postorder_ebbs. This is a more accurate description. Further return the ebbs in a btreemap so that the index of each Ebb (its order of visitation) is quick to lookup.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index e221f55fc..c853d8183 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -24,8 +24,9 @@ use ir::Function; use ir::entities::{Inst, Ebb}; -use ir::instructions::BranchInfo; +use ir::instructions::InstructionData; use entity_map::Enti...
1
89
23
8d93fe9685b42118a6b4ecb1d3cea99177db0f99
Jakob Stoklund Olesen
2016-07-22T22:38:53
Add an analyze_branch method to InstructionData. Rather than switching on instruction formats to discover the destination of a branch, use the analyze_branch method which returns a BranchInfo enum with just the relevant information. This makes CFG algorithms independent of future instruction formats for branches. Onl...
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 964a07a57..e221f55fc 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -24,7 +24,7 @@ use ir::Function; use ir::entities::{Inst, Ebb}; -use ir::instructions::InstructionData; +use ir::instruc...
2
47
9
ae98edf8cc6fcc70ddd42b552ca1c9199b1f4f12
Jakob Stoklund Olesen
2016-07-22T22:38:53
Add an analyze_branch method to InstructionData. Rather than switching on instruction formats to discover the destination of a branch, use the analyze_branch method which returns a BranchInfo enum with just the relevant information. This makes CFG algorithms independent of future instruction formats for branches. Onl...
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 964a07a57..e221f55fc 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -24,7 +24,7 @@ use ir::Function; use ir::entities::{Inst, Ebb}; -use ir::instructions::InstructionData; +use ir::instructions::BranchInfo; use entity_map::Enti...
2
47
9
ba76f444abccc720d327f7bffd4f7025572d52e7
Jakob Stoklund Olesen
2016-07-22T21:10:39
Add a keys() iterator to EntityMap.
diff --git a/cranelift/src/libcretonne/entity_map.rs b/cranelift/src/libcretonne/entity_map.rs index 0a7faccb4..9ce39bec1 100644 --- a/cranelift/src/libcretonne/entity_map.rs +++ b/cranelift/src/libcretonne/entity_map.rs @@ -81,6 +81,15 @@ impl<K, V> EntityMap<K, V> pub fn len(&self) -> usize { self.elems...
1
41
1
410c1390d12e064113eca81f1d32ee62ea7fc787
Jakob Stoklund Olesen
2016-07-22T21:10:39
Add a keys() iterator to EntityMap.
diff --git a/src/libcretonne/entity_map.rs b/src/libcretonne/entity_map.rs index 0a7faccb4..9ce39bec1 100644 --- a/src/libcretonne/entity_map.rs +++ b/src/libcretonne/entity_map.rs @@ -81,6 +81,15 @@ impl<K, V> EntityMap<K, V> pub fn len(&self) -> usize { self.elems.len() } + + /// Iterate over al...
1
41
1
27cb00ef42dcca40bfe1035c254d61a6e0d61c8b
Jakob Stoklund Olesen
2016-07-22T16:34:28
Rename the 'repr' module to 'ir'. This module and its submodules define the Intermidiate Representation of the Cretonne IL.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index c018ab467..970af69af 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -22,9 +22,9 @@ //! Here Ebb1 and Ebb2 would each have a single predecessor denoted as (Ebb0, `brz vx, Ebb1`) //! and (Ebb0...
15
45
45
38815dcca33babe2095ac4d2d305aa5a4c41d720
Jakob Stoklund Olesen
2016-07-22T16:34:28
Rename the 'repr' module to 'ir'. This module and its submodules define the Intermidiate Representation of the Cretonne IL.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index c018ab467..970af69af 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -22,9 +22,9 @@ //! Here Ebb1 and Ebb2 would each have a single predecessor denoted as (Ebb0, `brz vx, Ebb1`) //! and (Ebb0, `jmp Ebb2`) respectively. -use repr:...
15
45
45
3d59a95b0dc83d2682157d63c687701dd4f554f6
Morgan Phillips
2016-07-22T05:44:13
Replace btreesets with vectors.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 77f40a6f9..c018ab467 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -26,36 +26,22 @@ use repr::Function; use repr::entities::{Inst, Ebb}; use repr::instructions::InstructionData; use entity...
1
45
33
367752be1d337b41bfb293aa75f6063295c60fdc
Morgan Phillips
2016-07-22T05:44:13
Replace btreesets with vectors.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 77f40a6f9..c018ab467 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -26,36 +26,22 @@ use repr::Function; use repr::entities::{Inst, Ebb}; use repr::instructions::InstructionData; use entity_map::EntityMap; -use std::collections::...
1
45
33
4de89a7f96c6879aa788ff1f335327c2be6587a0
Morgan Phillips
2016-07-21T22:24:07
Cargo-fmt fixes
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index e73e0d04b..77f40a6f9 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -45,7 +45,7 @@ pub struct CFGNode { impl CFGNode { /// CFG Node successors stripped of loop edges. pub fn childre...
1
3
2
bdab73b0c7ad5ce21591035ccda4c8263074b683
Morgan Phillips
2016-07-21T22:24:07
Cargo-fmt fixes
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index e73e0d04b..77f40a6f9 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -45,7 +45,7 @@ pub struct CFGNode { impl CFGNode { /// CFG Node successors stripped of loop edges. pub fn children(&self) -> Vec<Ebb> { - let pred...
1
3
2
5037cc4db698705759f3d8df124a13c3108f0d63
Morgan Phillips
2016-07-21T22:22:27
Add support for postorder traversal of the cfg.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 9fabdff16..e73e0d04b 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -42,6 +42,15 @@ pub struct CFGNode { pub predecessors: BasicBlockSet, } +impl CFGNode { + /// CFG Node successors...
1
69
0
761fb54d8ae3f420abcefeaa11b8c09c666fa6d7
Morgan Phillips
2016-07-21T22:22:27
Add support for postorder traversal of the cfg.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 9fabdff16..e73e0d04b 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -42,6 +42,15 @@ pub struct CFGNode { pub predecessors: BasicBlockSet, } +impl CFGNode { + /// CFG Node successors stripped of loop edges. + pub fn chi...
1
69
0
a4126108a033081449558ed29ce7d98e0704dacb
Morgan Phillips
2016-07-21T19:36:51
Track predecessors as well as successors in the CFG
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index c6363ef21..9fabdff16 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -1,4 +1,6 @@ -//! A control flow graph represented as mappings of extended basic blocks to their predecessors. +//! A contro...
2
61
18
30eb25d013ece38a16576156bb91910bc2622a3b
Morgan Phillips
2016-07-21T19:36:51
Track predecessors as well as successors in the CFG
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index c6363ef21..9fabdff16 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -1,4 +1,6 @@ -//! A control flow graph represented as mappings of extended basic blocks to their predecessors. +//! A control flow graph represented as mappings of ...
2
61
18
505d49ec41b1c7a6014edd98d701dafa7d56bf50
Morgan Phillips
2016-07-21T19:08:02
Use EntityMap instead of BTreeMap
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index c2a2b6dcf..c6363ef21 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -1,5 +1,5 @@ //! A control flow graph represented as mappings of extended basic blocks to their predecessors. -//! Predeces...
2
53
25
2caa802f50ca9f5ee5a65dde1ed5cc9942b483d8
Morgan Phillips
2016-07-21T19:08:02
Use EntityMap instead of BTreeMap
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index c2a2b6dcf..c6363ef21 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -1,5 +1,5 @@ //! A control flow graph represented as mappings of extended basic blocks to their predecessors. -//! Predecessors are denoted by tuples of EBB and br...
2
53
25
28069ff2a0d3067f6561f410342a2e9345f9271e
Jakob Stoklund Olesen
2016-07-19T21:10:30
Move IR modules under repr/. Use the cretonne::repr module as a common namespace for sub-modules defining the in-memory representation of Cretonn IL.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index e9ecd9d98..c2a2b6dcf 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -21,8 +21,8 @@ //! and (Ebb0, `jmp Ebb2`) respectively. use repr::Function; -use entities::{Inst, Ebb}; -use instruction...
15
46
45
89ba9626c730be10edf4fa97d019f95dd140691e
Jakob Stoklund Olesen
2016-07-19T21:10:30
Move IR modules under repr/. Use the cretonne::repr module as a common namespace for sub-modules defining the in-memory representation of Cretonn IL.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index e9ecd9d98..c2a2b6dcf 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -21,8 +21,8 @@ //! and (Ebb0, `jmp Ebb2`) respectively. use repr::Function; -use entities::{Inst, Ebb}; -use instructions::InstructionData; +use repr::entities:...
15
46
45
28804e0b417c443a32c7e63218641e7179f00e06
Jakob Stoklund Olesen
2016-07-19T20:05:28
Use DataFlowGraph in Function. Replace the three tables instructions, extended_basic_blocks, and extended_values with a single 'dfg' public member. Clients using Function are changed to refer to func.layout and func.dfg respectively.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 3a5f55437..e9ecd9d98 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -56,7 +56,7 @@ impl ControlFlowGraph { // Flips to true when a terminating instruction is seen. So that if addi...
6
38
468
c1806d0ab04ec6d240216e3fb82a623df5fb880b
Jakob Stoklund Olesen
2016-07-19T20:05:28
Use DataFlowGraph in Function. Replace the three tables instructions, extended_basic_blocks, and extended_values with a single 'dfg' public member. Clients using Function are changed to refer to func.layout and func.dfg respectively.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 3a5f55437..e9ecd9d98 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -56,7 +56,7 @@ impl ControlFlowGraph { // Flips to true when a terminating instruction is seen. So that if additional // instructions occu...
6
38
468
8a55ed59deb2f332622fc2b9b6f05bc37d064720
Jakob Stoklund Olesen
2016-07-19T17:19:29
Implement separate data flow graph module. The DFG keeps track of instruction definitions, values, and EBBs. Store the primary definition of each instruction: Opcode and operands. Track SSA values as either the result of an instruction or EBB arguments.
diff --git a/cranelift/src/libcretonne/dfg.rs b/cranelift/src/libcretonne/dfg.rs new file mode 100644 index 000000000..7cfdaa7fb --- /dev/null +++ b/cranelift/src/libcretonne/dfg.rs @@ -0,0 +1,420 @@ +//! Data flow graph tracking Instructions, Values, and EBBs. + +use entity_map::EntityMap; +use entities::{Ebb, Inst, V...
2
421
0
39d3a8e3d76db29cc495460a86990753cd67f219
Jakob Stoklund Olesen
2016-07-19T17:19:29
Implement separate data flow graph module. The DFG keeps track of instruction definitions, values, and EBBs. Store the primary definition of each instruction: Opcode and operands. Track SSA values as either the result of an instruction or EBB arguments.
diff --git a/src/libcretonne/dfg.rs b/src/libcretonne/dfg.rs new file mode 100644 index 000000000..7cfdaa7fb --- /dev/null +++ b/src/libcretonne/dfg.rs @@ -0,0 +1,420 @@ +//! Data flow graph tracking Instructions, Values, and EBBs. + +use entity_map::EntityMap; +use entities::{Ebb, Inst, Value, NO_VALUE, ExpandedValue}...
2
421
0
78ce51e166f0bc6c7d8371851dd7c277be79b1dc
Jakob Stoklund Olesen
2016-07-19T16:25:05
Don't require Clone + Default for EntityMap values. There are two kinds of entity maps: - A primary map is used to allocate entity references and store the primary entity data. This map only grows when adding new entities with 'push'. - A secondary map contains additional information about entities in a primary ...
diff --git a/cranelift/src/libcretonne/entity_map.rs b/cranelift/src/libcretonne/entity_map.rs index 2aa101f5c..7954996ed 100644 --- a/cranelift/src/libcretonne/entity_map.rs +++ b/cranelift/src/libcretonne/entity_map.rs @@ -39,17 +39,23 @@ pub trait EntityRef: Copy + Eq { } /// A mapping `K -> V` for densely index...
2
45
23
d64e7fb576a86828e84007920fe1555cbb610d68
Jakob Stoklund Olesen
2016-07-19T16:25:05
Don't require Clone + Default for EntityMap values. There are two kinds of entity maps: - A primary map is used to allocate entity references and store the primary entity data. This map only grows when adding new entities with 'push'. - A secondary map contains additional information about entities in a primary ...
diff --git a/src/libcretonne/entity_map.rs b/src/libcretonne/entity_map.rs index 2aa101f5c..7954996ed 100644 --- a/src/libcretonne/entity_map.rs +++ b/src/libcretonne/entity_map.rs @@ -39,17 +39,23 @@ pub trait EntityRef: Copy + Eq { } /// A mapping `K -> V` for densely indexed entity references. +/// +/// A *prima...
2
45
23
79211cb8a647437f6357eb0422efe4aabff56f08
Morgan Phillips
2016-07-19T03:30:33
Fix formatting
diff --git a/cranelift/src/libcretonne/lib.rs b/cranelift/src/libcretonne/lib.rs index d5c501477..0223e4a4b 100644 --- a/cranelift/src/libcretonne/lib.rs +++ b/cranelift/src/libcretonne/lib.rs @@ -19,4 +19,4 @@ pub mod cfg; pub mod entity_map; -#[cfg(test)] pub mod test_utils; +#[cfg(test)]pub mod test_utils; diff...
3
4
10
f63d7941ede9977847c3ea39f0ead12b63b39bb3
Morgan Phillips
2016-07-19T03:30:33
Fix formatting
diff --git a/src/libcretonne/lib.rs b/src/libcretonne/lib.rs index d5c501477..0223e4a4b 100644 --- a/src/libcretonne/lib.rs +++ b/src/libcretonne/lib.rs @@ -19,4 +19,4 @@ pub mod cfg; pub mod entity_map; -#[cfg(test)] pub mod test_utils; +#[cfg(test)]pub mod test_utils; diff --git a/src/libcretonne/test_utils/make...
3
4
10
652ebbdc27dca3151cd20f1101f669265d78f723
Jakob Stoklund Olesen
2016-07-19T01:52:35
Use EBB layout order almost everywhere. The ebbs_numerically() function was a workaround for the unimplemented EBB layout order.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index af877f4f9..3a5f55437 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -48,11 +48,11 @@ impl ControlFlowGraph { // Even ebbs without predecessors should show up in the CFG, albeit ...
4
6
6
8c58fe463169c596b3200e4b4ee4505bfe681665
Jakob Stoklund Olesen
2016-07-19T01:52:35
Use EBB layout order almost everywhere. The ebbs_numerically() function was a workaround for the unimplemented EBB layout order.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index af877f4f9..3a5f55437 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -48,11 +48,11 @@ impl ControlFlowGraph { // Even ebbs without predecessors should show up in the CFG, albeit // with no entires. - for eb...
4
6
6
4f7c624ba676bc696cf224d4f0bd3e9807042a4f
Jakob Stoklund Olesen
2016-07-19T01:47:42
Implement IntoIterator for Layout.
diff --git a/cranelift/src/libcretonne/layout.rs b/cranelift/src/libcretonne/layout.rs index e0ca2cc3c..3cc2ffc03 100644 --- a/cranelift/src/libcretonne/layout.rs +++ b/cranelift/src/libcretonne/layout.rs @@ -3,7 +3,7 @@ //! The order of extended basic blocks in a function and the order of instructions in an EBB is /...
1
20
1
4ee2ab5042c821dd7b9fa47df9cd63f86b74b784
Jakob Stoklund Olesen
2016-07-19T01:47:42
Implement IntoIterator for Layout.
diff --git a/src/libcretonne/layout.rs b/src/libcretonne/layout.rs index e0ca2cc3c..3cc2ffc03 100644 --- a/src/libcretonne/layout.rs +++ b/src/libcretonne/layout.rs @@ -3,7 +3,7 @@ //! The order of extended basic blocks in a function and the order of instructions in an EBB is //! determined by the `Layout` data struc...
1
20
1
d73c2c9dc0780195599be475a20310a932d9a57f
Jakob Stoklund Olesen
2016-07-19T01:23:32
Replace inst_order with Layout in Function. The Layout also handles EBB layout, so new append_ebb calls are necessary. - Rewrite callers to use the public data member 'layout'. - Implement Debug for Function in terms of the write module to avoid deriving it.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 668f5b51e..af877f4f9 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -55,7 +55,7 @@ impl ControlFlowGraph { for ebb in func.ebbs_numerically() { // Flips to true when a te...
5
58
105
e926674b4e48ca61ff3d372e0694ae4470cc5007
Jakob Stoklund Olesen
2016-07-19T01:23:32
Replace inst_order with Layout in Function. The Layout also handles EBB layout, so new append_ebb calls are necessary. - Rewrite callers to use the public data member 'layout'. - Implement Debug for Function in terms of the write module to avoid deriving it.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 668f5b51e..af877f4f9 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -55,7 +55,7 @@ impl ControlFlowGraph { for ebb in func.ebbs_numerically() { // Flips to true when a terminating instruction is seen. So that i...
5
58
105
0ef0937016666e39a4c69cfc43177cdefa50aecf
Jakob Stoklund Olesen
2016-07-19T01:09:31
More layout tests and bugfixes. Fix bugs in append methods. Linked lists are hard.
diff --git a/cranelift/src/libcretonne/layout.rs b/cranelift/src/libcretonne/layout.rs index d803858d0..e0ca2cc3c 100644 --- a/cranelift/src/libcretonne/layout.rs +++ b/cranelift/src/libcretonne/layout.rs @@ -67,14 +67,18 @@ impl Layout { pub fn append_ebb(&mut self, ebb: Ebb) { assert!(!self.is_ebb_inser...
1
122
10
2f74efd5fc3258a6a1f3a9ddbc95c4109de16086
Jakob Stoklund Olesen
2016-07-19T01:09:31
More layout tests and bugfixes. Fix bugs in append methods. Linked lists are hard.
diff --git a/src/libcretonne/layout.rs b/src/libcretonne/layout.rs index d803858d0..e0ca2cc3c 100644 --- a/src/libcretonne/layout.rs +++ b/src/libcretonne/layout.rs @@ -67,14 +67,18 @@ impl Layout { pub fn append_ebb(&mut self, ebb: Ebb) { assert!(!self.is_ebb_inserted(ebb), "Cannot appen...
1
122
10
bd2945ab5e22db375758cbcfefca416de4a23549
Jakob Stoklund Olesen
2016-07-18T22:04:37
Implement instruction order. Each EBB has a linked list of instructions in layout order.
diff --git a/cranelift/src/libcretonne/layout.rs b/cranelift/src/libcretonne/layout.rs index 15748eda6..d803858d0 100644 --- a/cranelift/src/libcretonne/layout.rs +++ b/cranelift/src/libcretonne/layout.rs @@ -139,32 +139,53 @@ impl Layout { /// Get the EBB containing `inst`, or `None` if `inst` is not inserted in ...
1
92
12
21c2474d4dac59256d7d2a51a19b2ea41d53cffb
Jakob Stoklund Olesen
2016-07-18T22:04:37
Implement instruction order. Each EBB has a linked list of instructions in layout order.
diff --git a/src/libcretonne/layout.rs b/src/libcretonne/layout.rs index 15748eda6..d803858d0 100644 --- a/src/libcretonne/layout.rs +++ b/src/libcretonne/layout.rs @@ -139,32 +139,53 @@ impl Layout { /// Get the EBB containing `inst`, or `None` if `inst` is not inserted in the layout. pub fn inst_ebb(&self, ...
1
92
12
0d924c67d08bac9fcf4a07de31054fcee1f98450
Jakob Stoklund Olesen
2016-07-18T21:06:03
Add Layout::ebbs() and the corresponding iterator. Implement some tests, fix bugs in is_ebb_inserted().
diff --git a/cranelift/src/libcretonne/layout.rs b/cranelift/src/libcretonne/layout.rs index a870e5616..15748eda6 100644 --- a/cranelift/src/libcretonne/layout.rs +++ b/cranelift/src/libcretonne/layout.rs @@ -3,7 +3,8 @@ //! The order of extended basic blocks in a function and the order of instructions in an EBB is /...
1
90
11
a641bdb1f262f32f125c77d14edb2972600bb7f0
Jakob Stoklund Olesen
2016-07-18T21:06:03
Add Layout::ebbs() and the corresponding iterator. Implement some tests, fix bugs in is_ebb_inserted().
diff --git a/src/libcretonne/layout.rs b/src/libcretonne/layout.rs index a870e5616..15748eda6 100644 --- a/src/libcretonne/layout.rs +++ b/src/libcretonne/layout.rs @@ -3,7 +3,8 @@ //! The order of extended basic blocks in a function and the order of instructions in an EBB is //! determined by the `Layout` data struc...
1
90
11
ea3d2f0bbdadfd443015de510ad7f696fa359089
Morgan Phillips
2016-07-18T21:28:00
Move test utility functions to their own module
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 8c423c23a..668f5b51e 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -94,37 +94,10 @@ impl ControlFlowGraph { #[cfg(test)] mod tests { - use instructions::*; - use entity_map::EntityR...
4
47
34
28c1eda4f691c5b0c7d23004b32cfd746c817540
Morgan Phillips
2016-07-18T21:28:00
Move test utility functions to their own module
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 8c423c23a..668f5b51e 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -94,37 +94,10 @@ impl ControlFlowGraph { #[cfg(test)] mod tests { - use instructions::*; - use entity_map::EntityRef; - use entities::{Ebb, Inst, NO_VA...
4
47
34
c76ba3a7f666527b6b9aa107b4e538988d1e7503
Jakob Stoklund Olesen
2016-07-18T21:25:28
Add an EntityRef::wrap() method. This is the opposite of unwrap(). It converts the ad-hoc null references like NO_EBB and NO_INST into the more standard Option<Ebb> type which unfortunately takes twice as much space in data structures.
diff --git a/cranelift/src/libcretonne/entity_map.rs b/cranelift/src/libcretonne/entity_map.rs index fbf8109d9..2aa101f5c 100644 --- a/cranelift/src/libcretonne/entity_map.rs +++ b/cranelift/src/libcretonne/entity_map.rs @@ -11,13 +11,31 @@ use std::ops::{Index, IndexMut}; /// A type wrapping a small integer index s...
1
20
2
b9975f77af140ad43447f9842b11699f683251c2
Jakob Stoklund Olesen
2016-07-18T21:25:28
Add an EntityRef::wrap() method. This is the opposite of unwrap(). It converts the ad-hoc null references like NO_EBB and NO_INST into the more standard Option<Ebb> type which unfortunately takes twice as much space in data structures.
diff --git a/src/libcretonne/entity_map.rs b/src/libcretonne/entity_map.rs index fbf8109d9..2aa101f5c 100644 --- a/src/libcretonne/entity_map.rs +++ b/src/libcretonne/entity_map.rs @@ -11,13 +11,31 @@ use std::ops::{Index, IndexMut}; /// A type wrapping a small integer index should implement `EntityRef` so it can be...
1
20
2
32f40168b585ad61902757781c2902adec78c7e4
Morgan Phillips
2016-07-16T22:33:30
Remove extra newline
diff --git a/cranelift/src/tools/print_cfg.rs b/cranelift/src/tools/print_cfg.rs index fc85cbebe..002c206e0 100644 --- a/cranelift/src/tools/print_cfg.rs +++ b/cranelift/src/tools/print_cfg.rs @@ -21,7 +21,6 @@ pub fn run(files: Vec<String>) -> CommandResult { Ok(()) } - struct CFGPrinter<T: Write> { leve...
1
0
1
8bbc75e39f5d7f186a4190050cf00c666b1c7bca
Morgan Phillips
2016-07-16T22:33:30
Remove extra newline
diff --git a/src/tools/print_cfg.rs b/src/tools/print_cfg.rs index fc85cbebe..002c206e0 100644 --- a/src/tools/print_cfg.rs +++ b/src/tools/print_cfg.rs @@ -21,7 +21,6 @@ pub fn run(files: Vec<String>) -> CommandResult { Ok(()) } - struct CFGPrinter<T: Write> { level: usize, writer: T,
1
0
1
d3ed162bac9980e1e0895a0d8586d6526355c481
Jakob Stoklund Olesen
2016-07-15T18:33:10
Begin a layout module. The Layout data structure will keep track of the order of EBBs and their instructions. WIP.
diff --git a/cranelift/src/libcretonne/layout.rs b/cranelift/src/libcretonne/layout.rs new file mode 100644 index 000000000..a870e5616 --- /dev/null +++ b/cranelift/src/libcretonne/layout.rs @@ -0,0 +1,142 @@ +//! Function layout. +//! +//! The order of extended basic blocks in a function and the order of instructions ...
2
143
0
5c15dcdebb5127cc88a1e5b475054a83050d6a32
Jakob Stoklund Olesen
2016-07-15T18:33:10
Begin a layout module. The Layout data structure will keep track of the order of EBBs and their instructions. WIP.
diff --git a/src/libcretonne/layout.rs b/src/libcretonne/layout.rs new file mode 100644 index 000000000..a870e5616 --- /dev/null +++ b/src/libcretonne/layout.rs @@ -0,0 +1,142 @@ +//! Function layout. +//! +//! The order of extended basic blocks in a function and the order of instructions in an EBB is +//! determined b...
2
143
0
4358a4d96ed70d2ac6266bab2385c5cc5b1ea166
Jakob Stoklund Olesen
2016-07-15T22:31:13
Implement EntityRef for most of the entities module. The only exception is Value which has two dimensions.
diff --git a/cranelift/src/libcretonne/cfg.rs b/cranelift/src/libcretonne/cfg.rs index 4fc2f1b29..8c423c23a 100644 --- a/cranelift/src/libcretonne/cfg.rs +++ b/cranelift/src/libcretonne/cfg.rs @@ -95,6 +95,7 @@ impl ControlFlowGraph { #[cfg(test)] mod tests { use instructions::*; + use entity_map::EntityRef; ...
4
30
18
99464bc29de93ac2a4d7759cf5d248dc4b6d8b86
Jakob Stoklund Olesen
2016-07-15T22:31:13
Implement EntityRef for most of the entities module. The only exception is Value which has two dimensions.
diff --git a/src/libcretonne/cfg.rs b/src/libcretonne/cfg.rs index 4fc2f1b29..8c423c23a 100644 --- a/src/libcretonne/cfg.rs +++ b/src/libcretonne/cfg.rs @@ -95,6 +95,7 @@ impl ControlFlowGraph { #[cfg(test)] mod tests { use instructions::*; + use entity_map::EntityRef; use entities::{Ebb, Inst, NO_VALUE}...
4
30
18
e87439341907e29b883f378beb60b94c0ac95718
Jakob Stoklund Olesen
2016-07-15T22:14:16
Add an entity_map module. This supports the pattern of creating structs wrapping a u32 and using them as indexes into a vector of entities. These entity references should implement the EntityRef trait. The EntityMap is a generic map from an EntityRef to some value type. It expects densely indexed entities and uses a ...
diff --git a/cranelift/src/libcretonne/entity_map.rs b/cranelift/src/libcretonne/entity_map.rs new file mode 100644 index 000000000..3e1f16a59 --- /dev/null +++ b/cranelift/src/libcretonne/entity_map.rs @@ -0,0 +1,130 @@ +//! Densely numbered entity references as mapping keys. +//! +//! This module defines an `EntityRe...
2
132
0