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
e67f5e210fb7bc540f68d5b081fed5b13f072d64
Jakob Stoklund Olesen
2017-04-26T17:11:50
Add a TargetIsa::regclass_for_abi_type() function. The legalize_signature() function will return ArgumentLoc::Reg arguments that contain a register unit. However, the register also needs to be able to associate a register class with the argument values to fully track the used registers. When values are defined by ins...
diff --git a/lib/cretonne/src/isa/arm32/abi.rs b/lib/cretonne/src/isa/arm32/abi.rs new file mode 100644 index 000000000..c4e0ffc2e --- /dev/null +++ b/lib/cretonne/src/isa/arm32/abi.rs @@ -0,0 +1,27 @@ +//! ARM ABI implementation. + +use ir; +use isa::RegClass; +use settings as shared_settings; +use super::registers::{...
9
114
8
d078c546e57b395697d4b7d4df8fd761da170beb
Jakob Stoklund Olesen
2017-04-25T22:50:59
Add an EntityMap::get_or_default() method. This covers a common pattern for secondary entity maps: Get the value in the map or the default value for out-of-range keys.
diff --git a/cranelift/src/filetest/binemit.rs b/cranelift/src/filetest/binemit.rs index 449e0887e..2f695bff1 100644 --- a/cranelift/src/filetest/binemit.rs +++ b/cranelift/src/filetest/binemit.rs @@ -106,10 +106,7 @@ impl SubTest for TestBinEmit { // Give an encoding to any instruction that doesn't already ha...
5
10
18
c36aedfd03a5c5491364d814512302acf1569e2d
Jakob Stoklund Olesen
2017-04-25T22:50:59
Add an EntityMap::get_or_default() method. This covers a common pattern for secondary entity maps: Get the value in the map or the default value for out-of-range keys.
diff --git a/lib/cretonne/src/binemit/relaxation.rs b/lib/cretonne/src/binemit/relaxation.rs index 179540dad..74158a61e 100644 --- a/lib/cretonne/src/binemit/relaxation.rs +++ b/lib/cretonne/src/binemit/relaxation.rs @@ -64,7 +64,7 @@ pub fn relax_branches(func: &mut Function, isa: &TargetIsa) { } ...
5
10
18
440add86e70055e6654f79a4459809507dc2cc75
Eric Anholt
2017-04-23T18:55:14
Make sure that encodings has entries for all instructions after legalize(). If we generated new instructions as part of legalize, and the new instructions failed to legalize, we'd be left with a func.encodings[] that would panic when you dereferenced the inst.
diff --git a/lib/cretonne/src/legalizer/mod.rs b/lib/cretonne/src/legalizer/mod.rs index 50300027a..edd233cce 100644 --- a/lib/cretonne/src/legalizer/mod.rs +++ b/lib/cretonne/src/legalizer/mod.rs @@ -100,6 +100,7 @@ pub fn legalize_function(func: &mut Function, cfg: &mut ControlFlowGraph, isa: & prev_pos ...
1
1
0
d47f43df11ad99f637311a0bc3983e6ae852e04b
Eric Anholt
2017-04-23T18:45:12
Make sure we double back after legalizing an instruction. The other legalizer cases have a continue after setting the position to double back, while this one didn't. Make sure that we do, in case another legalizer block is added after this one.
diff --git a/lib/cretonne/src/legalizer/mod.rs b/lib/cretonne/src/legalizer/mod.rs index 7949aed31..50300027a 100644 --- a/lib/cretonne/src/legalizer/mod.rs +++ b/lib/cretonne/src/legalizer/mod.rs @@ -91,6 +91,7 @@ pub fn legalize_function(func: &mut Function, cfg: &mut ControlFlowGraph, isa: & // ...
1
1
0
042418b36754a8230eadbbc41400879fa7b24dd7
Eric Anholt
2017-04-23T00:39:43
Update a comment for the move of display_enc().
diff --git a/lib/cretonne/src/isa/encoding.rs b/lib/cretonne/src/isa/encoding.rs index c5151978a..3d866727a 100644 --- a/lib/cretonne/src/isa/encoding.rs +++ b/lib/cretonne/src/isa/encoding.rs @@ -60,7 +60,7 @@ impl fmt::Display for Encoding { } /// Temporary object that holds enough context to properly display an ...
1
1
1
d0d5f3bb2659e4f5c2ee98ce071a4ccbac18a438
Jakob Stoklund Olesen
2017-04-21T23:23:33
Run the post-regalloc verification inside the regalloc context. This means that we can verify the basics with verify_context before moving on to verifying the liveness information. Live ranges are now verified immediately after computing them and after register allocation is complete.
diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs index f8a207c6f..e4ba8a066 100644 --- a/lib/cretonne/src/context.rs +++ b/lib/cretonne/src/context.rs @@ -54,7 +54,7 @@ impl Context { /// The `TargetIsa` argument is currently unused, but the verifier will soon be able to also /// check I...
3
13
10
c5da572ebbd0b88196ea790454c40fd86237bf16
Jakob Stoklund Olesen
2017-04-21T20:35:20
Add a liveness verifier. The liveness verifier will check that the live ranges are consistent with the function. It runs as part of the register allocation pipeline when enable_verifier is set. The initial implementation checks the live ranges, but not the ISA-specific constraints and affinities.
diff --git a/cranelift/src/utils.rs b/cranelift/src/utils.rs index 3519c5562..1bcba4891 100644 --- a/cranelift/src/utils.rs +++ b/cranelift/src/utils.rs @@ -40,7 +40,7 @@ pub fn pretty_verifier_error(func: &ir::Function, err: verifier::Error) -> Strin AnyEntity::Inst(inst) => { write!(msg, "\n{}: ...
6
220
23
85f277a2fbf0c5143804d2012f8a2158846f551a
Jakob Stoklund Olesen
2017-04-21T20:35:20
Add a liveness verifier. The liveness verifier will check that the live ranges are consistent with the function. It runs as part of the register allocation pipeline when enable_verifier is set. The initial implementation checks the live ranges, but not the ISA-specific constraints and affinities.
diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs index 71dfa4539..f8a207c6f 100644 --- a/lib/cretonne/src/context.rs +++ b/lib/cretonne/src/context.rs @@ -81,7 +81,7 @@ impl Context { /// Run the register allocator. pub fn regalloc(&mut self, isa: &TargetIsa) -> CtonResult { sel...
6
220
23
c4b794f7cf822223bb031862d33fc720f5a72cd8
Jakob Stoklund Olesen
2017-04-21T19:36:35
Run the verifier in the Context methods when it is enabled. The test drivers can stop calling comp_ctx.verify because legalize() and regalloc() do it themselves now. This also makes it possible for those two passes to return other CtonError codes in the future, not just verifier errors.
diff --git a/cranelift/src/filetest/legalizer.rs b/cranelift/src/filetest/legalizer.rs index 1a5f77466..c6e08ffe2 100644 --- a/cranelift/src/filetest/legalizer.rs +++ b/cranelift/src/filetest/legalizer.rs @@ -8,7 +8,7 @@ use cretonne::{self, write_function}; use cretonne::ir::Function; use cton_reader::TestCommand; ...
4
32
11
225ed39fbdabdd9cad63e37852e1f7e85231aaa8
Jakob Stoklund Olesen
2017-04-21T19:36:35
Run the verifier in the Context methods when it is enabled. The test drivers can stop calling comp_ctx.verify because legalize() and regalloc() do it themselves now. This also makes it possible for those two passes to return other CtonError codes in the future, not just verifier errors.
diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs index 680ddbffe..71dfa4539 100644 --- a/lib/cretonne/src/context.rs +++ b/lib/cretonne/src/context.rs @@ -15,6 +15,7 @@ use ir::Function; use isa::TargetIsa; use legalize_function; use regalloc; +use result::CtonResult; use verifier; /// Pers...
4
32
11
6e95b08df192aab1de717bd136844f3ba08a7a4a
Jakob Stoklund Olesen
2017-04-21T19:03:05
Verifier results are always void. No need for a type parameter.
diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs index 051adc47a..680ddbffe 100644 --- a/lib/cretonne/src/context.rs +++ b/lib/cretonne/src/context.rs @@ -52,7 +52,7 @@ impl Context { /// /// The `TargetIsa` argument is currently unused, but the verifier will soon be able to also //...
2
24
24
bac47f2fb87c2859e5dc5281f1ccae1b70c8b1e3
Jakob Stoklund Olesen
2017-04-21T17:55:12
Add global CtonResult and CtonError types. These are for reporting the overall result of compiling a function.
diff --git a/lib/cretonne/src/lib.rs b/lib/cretonne/src/lib.rs index e44899f8c..986c45355 100644 --- a/lib/cretonne/src/lib.rs +++ b/lib/cretonne/src/lib.rs @@ -21,6 +21,7 @@ pub mod flowgraph; pub mod ir; pub mod isa; pub mod regalloc; +pub mod result; pub mod settings; pub mod sparse_map; pub mod verifier; diff...
3
76
0
d9ddf4fc5a7a867ce53aa5062c2523aa54e0fad3
Jakob Stoklund Olesen
2017-04-19T21:53:14
Simplify check_arg_types(). Iterator tricks.
diff --git a/lib/cretonne/src/legalizer/boundary.rs b/lib/cretonne/src/legalizer/boundary.rs index cb2794a49..537d6cb9d 100644 --- a/lib/cretonne/src/legalizer/boundary.rs +++ b/lib/cretonne/src/legalizer/boundary.rs @@ -290,21 +290,9 @@ fn convert_to_abi<PutArg>(dfg: &mut DataFlowGraph, /// Check if a sequence of a...
1
3
15
e5115d77938ffdd1d8668ec6c2b7fbf59dfd292d
Jakob Stoklund Olesen
2017-04-13T17:37:58
Remove detach_secondary_results() and other cleanups. - The detach_secondary_results() is a leftover from the two-plane value representation. Use detach_results() instead to remove all instruction results. - Make the append_* DFG methods more direct. Don't depend on calling the corresponding attach_* methods. Ju...
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index ad22a03fa..9f1a8b529 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -433,20 +433,6 @@ impl DataFlowGraph { ReplaceBuilder::new(self, inst) } - /// Detach secondary instruction results. - /// - ...
1
38
54
7ad882c154e70bce5c346447130f63c965847160
Jakob Stoklund Olesen
2017-04-13T16:45:36
Avoid creating value aliases in legalizer/split.rs. When we're splitting an EBB argument, we insert a iconcat/vconcat instruction that computes the original value from the new split arguments. The concat instruction can now define the original value directly, it is not necessary to define a new value and alias the ol...
diff --git a/lib/cretonne/src/legalizer/split.rs b/lib/cretonne/src/legalizer/split.rs index 3c03d1d77..764448b5b 100644 --- a/lib/cretonne/src/legalizer/split.rs +++ b/lib/cretonne/src/legalizer/split.rs @@ -228,9 +228,9 @@ fn split_value(dfg: &mut DataFlowGraph, // need to insert a split instruction ...
1
3
3
48b2f421b4151435cbdf84b3ed0ef8fa9e904e5c
Jakob Stoklund Olesen
2017-04-13T15:50:32
Add a with_results() method to the InsertBuilder. This makes it possible to reuse one or more result values in the instruction that is being inserted. Also add a with_result(v) method for the common case of reusing a single result value. This could be specialized in the future.
diff --git a/lib/cretonne/src/ir/builder.rs b/lib/cretonne/src/ir/builder.rs index 0414f7c28..d9ef0faa2 100644 --- a/lib/cretonne/src/ir/builder.rs +++ b/lib/cretonne/src/ir/builder.rs @@ -58,6 +58,36 @@ impl<'c, 'fc, 'fd> InsertBuilder<'c, 'fc, 'fd> { -> InsertBuilder<'c, 'fc, 'fd> { InsertBui...
1
86
1
3197f240ff4849808d2c54ff1445758ce662b044
Jakob Stoklund Olesen
2017-04-13T15:15:44
Add a make_inst_results_reusing() generic method. This is a generalization of the existing make_inst_results() which lets you provide some or all of the result values instead of creating all new ones.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 16af22cef..ad22a03fa 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -10,6 +10,7 @@ use ir::{Ebb, Inst, Value, Type, SigRef, Signature, FuncRef, ValueList, ValueLis use write::write_operands; use std::fmt; +use st...
1
30
2
d4f511ecfcdc28348c6ce7383d8918020e5fc911
Jakob Stoklund Olesen
2017-04-13T15:18:16
Return the removed instruction from Cursor::remove_inst(). This is convenient for asserting that the right instruction was removed.
diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs index aec53422f..6e3e79312 100644 --- a/lib/cretonne/src/ir/layout.rs +++ b/lib/cretonne/src/ir/layout.rs @@ -910,10 +910,13 @@ impl<'f> Cursor<'f> { /// Remove the instruction under the cursor. /// /// The cursor is left pointing...
1
6
3
801f4ade66874a4d2847782cf619d5079f67dd6c
Jakob Stoklund Olesen
2017-04-13T00:06:27
Add remove_inst() methods to Cursor and Layout. We didn't have a way of removing instructions again.
diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs index 4f5d2355b..aec53422f 100644 --- a/lib/cretonne/src/ir/layout.rs +++ b/lib/cretonne/src/ir/layout.rs @@ -460,6 +460,32 @@ impl Layout { self.assign_inst_seq(inst); } + /// Remove `inst` from the layout. + pub fn remove...
1
48
0
84c15e0e66f11e522165b06748c7b42d7a63539d
Jakob Stoklund Olesen
2017-04-12T22:12:58
Add some safety checks for detached values. These methods are used to reattach detached values: - change_to_alias - attach_result - attach_ebb_arg Add an assertion to all of them to ensure that the provided value is not already attached somewhere else. Use a new value_is_attached() method for the test. Also include...
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index a6a85ba24..16af22cef 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -156,6 +156,21 @@ impl DataFlowGraph { } } + /// Determine if `v` is an attached instruction result / EBB argument. + /// + ...
2
48
15
28ff7b792559d441f544950c53b5497bb60b9552
Jakob Stoklund Olesen
2017-04-12T20:14:03
Move the ctrl_typevar function into dfg. Soon, InstructionData won't have sufficient information to compute this. Give TargetIsa::encode() an explicit ctrl_typevar argument. This function does not require the instruction to be inserted in the DFG tables.
diff --git a/cranelift/src/filetest/binemit.rs b/cranelift/src/filetest/binemit.rs index f4ec6262c..449e0887e 100644 --- a/cranelift/src/filetest/binemit.rs +++ b/cranelift/src/filetest/binemit.rs @@ -110,7 +110,9 @@ impl SubTest for TestBinEmit { .get(inst) .map(|e| e....
11
69
53
9c6a36d36d49cb10374c2ece53848ad0b157d51d
Jakob Stoklund Olesen
2017-04-12T20:14:03
Move the ctrl_typevar function into dfg. Soon, InstructionData won't have sufficient information to compute this. Give TargetIsa::encode() an explicit ctrl_typevar argument. This function does not require the instruction to be inserted in the DFG tables.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index e00c1fe95..1aebfbb03 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -1,12 +1,13 @@ //! Data flow graph tracking Instructions, Values, and EBBs. -use ir::{Ebb, Inst, Value, Type, SigRef, Signature, FuncRef, ValueLi...
11
69
53
d133606fe7c7ab45c2847db9abbfa8fe4a496f22
Jakob Stoklund Olesen
2017-04-12T17:48:57
Don't assume all first results are direct values. We're about to change that.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 583f7cc8a..0b0ea7a8c 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -207,13 +207,12 @@ impl DataFlowGraph { /// Find the original definition of a value, looking through value aliases as well as /// copy/spi...
1
4
6
f8b473c4285d858851983112019c95e5dd49311d
Jakob Stoklund Olesen
2017-04-12T17:39:11
Add detach_results(), attach_result(), and append_result() methods. These low-level methods for manipulating instruction result value lists will replace the existing secondary_result methods.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 63849e1a7..583f7cc8a 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -511,6 +511,67 @@ impl DataFlowGraph { panic!("{} is not a secondary result value", value); } + /// Detach the list of result val...
1
61
0
0897d43c88484544324640c5e924927642172756
Jakob Stoklund Olesen
2017-04-12T16:45:21
Don't attach a first result in make_inst(). That is now the job of make_inst_results().
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index dc321030b..63849e1a7 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -322,13 +322,9 @@ impl DataFlowGraph { /// The type of the first result is indicated by `data.ty`. If the instruction produces /// multipl...
1
7
11
3a36435c3b5e81abfc1121c54f464734fc725ec7
Jakob Stoklund Olesen
2017-04-11T22:38:50
Maintain a ValueList with the results of each instruction. This is the first step of a larger refactoring to represent instruction results as value lists instead of using linked lists. The refactoring will also eliminate the special treatment of first results such that all result values can be detached and redefined. ...
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 63ae3a5e9..16de65fb3 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -28,14 +28,26 @@ pub struct DataFlowGraph { /// with the EBB containing each instruction. insts: EntityMap<Inst, InstructionData>, - ...
1
63
8
7b2becfb2189d6587b01b19c53b836b9658b1b1b
Jakob Stoklund Olesen
2017-04-11T23:03:49
Add EntityList::first(). This is the same as slice::first(), except it returns the first element by value. The implementation can avoid checking the list length since empty lists already have a special representation.
diff --git a/lib/cretonne/src/entity_list.rs b/lib/cretonne/src/entity_list.rs index 7e1101952..3b7493094 100644 --- a/lib/cretonne/src/entity_list.rs +++ b/lib/cretonne/src/entity_list.rs @@ -260,6 +260,15 @@ impl<T: EntityRef> EntityList<T> { self.as_slice(pool).get(index).cloned() } + /// Get the ...
1
14
0
fe0d986110c6f5121ab604eeb1f4826c92fd4cdc
Jakob Stoklund Olesen
2017-04-11T22:03:43
Make the dfg.insts table private again. - Add a dfg.is_inst_valid() method for the verifier. - Use the inst_args_mut() method when rewriting values in the parser. - Add a new branch_destination_mut() to use when rewriting EBBs. This also gets rid of one of the large instruction format switches in the parser.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 9178aeeb3..63ae3a5e9 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -26,7 +26,7 @@ pub struct DataFlowGraph { /// Data about all of the instructions in the function, including opcodes and operands. /// The ...
4
24
67
5209778ae2d419bd00c9b15c6001af7d30d9b558
Jakob Stoklund Olesen
2017-04-11T19:30:37
Stop maintaining a linked list of EBB arguments. Now that we have a value list of the arguments, we can get rid of: - The first_arg and last_arg members in EbbData, - The next member in the ValueData::Arg variant.
diff --git a/lib/cretonne/src/entity_list.rs b/lib/cretonne/src/entity_list.rs index d6f0e4911..7e1101952 100644 --- a/lib/cretonne/src/entity_list.rs +++ b/lib/cretonne/src/entity_list.rs @@ -295,7 +295,8 @@ impl<T: EntityRef> EntityList<T> { } /// Appends an element to the back of the list. - pub fn pu...
2
23
85
ca900d6bf88281f944c04f8bf7d82c4004518f87
Jakob Stoklund Olesen
2017-04-11T19:14:33
Return the whole value list from detach_ebb_args(). Rather than returning the head of a linked list of EBB arguments, just return the whole value list of all the arguments. Delete the next_ebb_arg() method which was only used for traversing that list.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index ffa842e5a..45485d63e 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -751,10 +751,7 @@ impl DataFlowGraph { self.ebbs[ebb].first_arg = new_arg.into(); } else { // We need to find the...
2
14
36
dd0a61cc9127098b559a9d4b7877cfd3d0f41963
Jakob Stoklund Olesen
2017-04-11T18:36:50
Keep EBB arguments in a ValueList. This is the first step of the value list refactoring which will replace linked lists of values with value lists. - Keep a ValueList in the EbbData struct containing all the EBB arguments. - Change dfg.ebb_args() to return a slice instead of an iterator. This leaves us in a tempor...
diff --git a/lib/cretonne/src/entity_list.rs b/lib/cretonne/src/entity_list.rs index 0b9026547..d6f0e4911 100644 --- a/lib/cretonne/src/entity_list.rs +++ b/lib/cretonne/src/entity_list.rs @@ -222,6 +222,11 @@ impl<T: EntityRef> ListPool<T> { } impl<T: EntityRef> EntityList<T> { + /// Create a new empty list. + ...
6
40
48
7c3bc9d19fddf3c327b0858b92f08d4d1bfb4d7f
Jakob Stoklund Olesen
2017-04-10T20:03:46
Add Offset32 support to the parser.
diff --git a/lib/reader/src/lexer.rs b/lib/reader/src/lexer.rs index e1e4cc31c..0e8eaccd0 100644 --- a/lib/reader/src/lexer.rs +++ b/lib/reader/src/lexer.rs @@ -223,7 +223,7 @@ impl<'a> Lexer<'a> { // - `0x0.4p-34`: Float // // This function does not filter out all invalid numbers. It depends in the cont...
2
33
9
5025bb67f4b68c518d0a3cf02f5cf026e330ff83
Jakob Stoklund Olesen
2017-04-06T20:58:48
Add an iterators module with extra Iterator methods. Start with an adjacent_pairs() iterator adapter.
diff --git a/lib/cretonne/src/iterators.rs b/lib/cretonne/src/iterators.rs new file mode 100644 index 000000000..3bdc3cc1c --- /dev/null +++ b/lib/cretonne/src/iterators.rs @@ -0,0 +1,90 @@ +//! Iterator utilities. + +/// Extra methods for iterators. +pub trait IteratorExtras: Iterator { + /// Create an iterator tha...
2
92
1
81251c300561f9eb02814a19159ecb636ecdf108
Jakob Stoklund Olesen
2017-04-05T21:54:17
Add a branch relaxation pass for #72. Compute exact EBB header offsets and check that branches are in range. Not implemented yet: Relax branches that are not in range. Invoke the relax_branches() pass from the 'test binemit' file tests so they can verify the proper encoding of branch instructions too.
diff --git a/cranelift/src/filetest/binemit.rs b/cranelift/src/filetest/binemit.rs index 50949811e..eee96e6ee 100644 --- a/cranelift/src/filetest/binemit.rs +++ b/cranelift/src/filetest/binemit.rs @@ -4,6 +4,7 @@ //! functions and compares the results to the expected output. use std::borrow::Cow; +use std::collecti...
6
221
39
b5c74fdc25614a73565a68bceb70e1437d570941
Jakob Stoklund Olesen
2017-04-05T21:54:17
Add a branch relaxation pass for #72. Compute exact EBB header offsets and check that branches are in range. Not implemented yet: Relax branches that are not in range. Invoke the relax_branches() pass from the 'test binemit' file tests so they can verify the proper encoding of branch instructions too.
diff --git a/lib/cretonne/src/binemit/mod.rs b/lib/cretonne/src/binemit/mod.rs index 972158603..33cce8d2b 100644 --- a/lib/cretonne/src/binemit/mod.rs +++ b/lib/cretonne/src/binemit/mod.rs @@ -3,6 +3,10 @@ //! The `binemit` module contains code for translating Cretonne's intermediate representation into //! binary ma...
6
221
39
72cb6459a908775246b472d95857c94585367e48
Jakob Stoklund Olesen
2017-04-05T16:12:12
Add a CodeOffset type and CodeSink::offset() method. We need to keep track of code offsets in order to compute accurate branch displacements.
diff --git a/cranelift/src/filetest/binemit.rs b/cranelift/src/filetest/binemit.rs index 3c9fc333e..50949811e 100644 --- a/cranelift/src/filetest/binemit.rs +++ b/cranelift/src/filetest/binemit.rs @@ -8,6 +8,7 @@ use std::fmt::Write; use cretonne::binemit; use cretonne::ir; use cretonne::ir::entities::AnyEntity; +us...
2
33
5
847c8045fd121c17ddd39d71cada2c0ae175a86f
Jakob Stoklund Olesen
2017-04-05T16:12:12
Add a CodeOffset type and CodeSink::offset() method. We need to keep track of code offsets in order to compute accurate branch displacements.
diff --git a/lib/cretonne/src/binemit/mod.rs b/lib/cretonne/src/binemit/mod.rs index ccad476f4..972158603 100644 --- a/lib/cretonne/src/binemit/mod.rs +++ b/lib/cretonne/src/binemit/mod.rs @@ -5,6 +5,12 @@ use ir::{Ebb, FuncRef, JumpTable, Function, Inst}; +/// Offset in bytes from the beginning of the function. +...
2
33
5
353dc72b5b06612966d9d1025e0368a45e79035f
Angus Holder
2017-03-30T22:34:50
Verify integrity of the existing control flow graph of the context. (#70) * Verify integrity of the existing control flow graph of the context. * Make checking more thorough.
diff --git a/lib/cretonne/src/ir/entities.rs b/lib/cretonne/src/ir/entities.rs index 51ca70ad7..42d109bf7 100644 --- a/lib/cretonne/src/ir/entities.rs +++ b/lib/cretonne/src/ir/entities.rs @@ -170,7 +170,7 @@ impl Display for Value { } /// An opaque reference to an instruction in a function. -#[derive(Copy, Clone, ...
2
52
38
cb33f93fcd48c7bc57a2328cc78c1ed586f44657
Jakob Stoklund Olesen
2017-03-29T22:30:44
Use pretty_verifier_error in runone too.
diff --git a/cranelift/src/filetest/runone.rs b/cranelift/src/filetest/runone.rs index ed4cae1ee..ec61c9824 100644 --- a/cranelift/src/filetest/runone.rs +++ b/cranelift/src/filetest/runone.rs @@ -9,7 +9,7 @@ use cretonne::settings::Flags; use cretonne::verify_function; use cton_reader::parse_test; use cton_reader::...
1
2
2
ffeeba7c93ad3764312b6ba6b0534053aafa4c6f
Jakob Stoklund Olesen
2017-03-29T22:30:44
Use pretty_verifier_error in runone too.
diff --git a/src/filetest/runone.rs b/src/filetest/runone.rs index ed4cae1ee..ec61c9824 100644 --- a/src/filetest/runone.rs +++ b/src/filetest/runone.rs @@ -9,7 +9,7 @@ use cretonne::settings::Flags; use cretonne::verify_function; use cton_reader::parse_test; use cton_reader::IsaSpec; -use utils::read_to_string; +us...
1
2
2
4c3e590bb92870a53f74103ec57b656ac10d7c1a
Jakob Stoklund Olesen
2017-03-29T22:16:59
Run verifier after legalizer and regalloc file tests. Run the verify_contexti() function after invoking the legalize() and regalloc() context functions. This will help catch bad code produced by these passes.
diff --git a/cranelift/src/filetest/legalizer.rs b/cranelift/src/filetest/legalizer.rs index 25247a5ab..39854769a 100644 --- a/cranelift/src/filetest/legalizer.rs +++ b/cranelift/src/filetest/legalizer.rs @@ -4,11 +4,11 @@ //! the result to filecheck. use std::borrow::Cow; -use cretonne::{legalize_function, write_f...
4
41
9
e1711f42f6891a5faaf804b0ed25eb9d31e9ddc2
Jakob Stoklund Olesen
2017-03-29T22:16:59
Run verifier after legalizer and regalloc file tests. Run the verify_contexti() function after invoking the legalize() and regalloc() context functions. This will help catch bad code produced by these passes.
diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs index 9ce9d4912..2d5631f62 100644 --- a/lib/cretonne/src/context.rs +++ b/lib/cretonne/src/context.rs @@ -15,6 +15,7 @@ use ir::Function; use isa::TargetIsa; use legalize_function; use regalloc; +use verifier; /// Persistent data structures an...
4
41
9
19710af5b728c85c838011cc3f3dfcef3469dd1a
Jakob Stoklund Olesen
2017-03-23T19:31:29
Start the binemit module. This module will provide supporting code for emitting binary machine code with relocations.
diff --git a/lib/cretonne/src/binemit/mod.rs b/lib/cretonne/src/binemit/mod.rs new file mode 100644 index 000000000..d3c97ec53 --- /dev/null +++ b/lib/cretonne/src/binemit/mod.rs @@ -0,0 +1,33 @@ +//! Binary machine code emission. +//! +//! The `binemit` module contains code for translating Cretonne's intermediate repr...
2
34
0
5027e096b5c41452607aae834ddeab8da635fe7f
Jakob Stoklund Olesen
2017-03-23T19:39:05
Add dfg.inst_args(_mut) methods. A shortcut for calling arguments() directly that goes with the existing inst_results() method.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index ae5e10f6a..24727362b 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -344,6 +344,16 @@ impl DataFlowGraph { DisplayInst(self, inst) } + /// Get the value arguments on `inst` as a slice. + pub fn ...
7
19
10
6fdbbf2b1af26c465d779de093d9e7c341e7a01e
Jakob Stoklund Olesen
2017-03-23T16:50:26
Legalize EBBs in a reverse post-order. This means that whenever we need to split a value, it is either already defined by a concatenation instruction in a previously processed EBB, or it's an EBB argument.
diff --git a/lib/cretonne/src/legalizer/mod.rs b/lib/cretonne/src/legalizer/mod.rs index b9dc49352..00354822a 100644 --- a/lib/cretonne/src/legalizer/mod.rs +++ b/lib/cretonne/src/legalizer/mod.rs @@ -29,10 +29,16 @@ mod split; pub fn legalize_function(func: &mut Function, cfg: &mut ControlFlowGraph, isa: &TargetIsa) ...
1
8
2
26ee382b57b37ebc331bcb85543441209de36637
Jakob Stoklund Olesen
2017-03-22T20:17:25
Fix weird indentation.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index e86b87de3..ae5e10f6a 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -178,24 +178,24 @@ impl DataFlowGraph { /// copy/spill/fill instructions. pub fn resolve_copies(&self, value: Value) -> Value { u...
1
16
16
d32c19c81da3da9e99c6dc1eddf1efde9338f9e4
Jakob Stoklund Olesen
2017-03-22T17:36:42
Add a DataFlowGraph::replace_ebb_arg() method. This is needed for rewriting EBB arguments with legalized types.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 8977cc675..e86b87de3 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -261,7 +261,7 @@ pub enum ValueDef { } // Internal table storage for extended values. -#[derive(Clone)] +#[derive(Clone, Debug)] enum ValueData...
1
92
1
a9056f699e7a11cdecfeb7c44c039222bbe77737
Jakob Stoklund Olesen
2017-03-21T22:33:23
Rename the 'cfg' module to 'flowgraph'. The 'cfg' name was easy to confuse with 'configuration'.
diff --git a/cranelift/src/filetest/domtree.rs b/cranelift/src/filetest/domtree.rs index 84b63177e..29bde6d13 100644 --- a/cranelift/src/filetest/domtree.rs +++ b/cranelift/src/filetest/domtree.rs @@ -11,14 +11,14 @@ //! We verify that the dominator tree annotations are complete and correct. //! -use std::collectio...
10
24
24
f84e218a932bf76220d7cc0a10fba2375af212ed
Jakob Stoklund Olesen
2017-03-21T22:33:23
Rename the 'cfg' module to 'flowgraph'. The 'cfg' name was easy to confuse with 'configuration'.
diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs index ce1e8b50f..a4fc155c4 100644 --- a/lib/cretonne/src/context.rs +++ b/lib/cretonne/src/context.rs @@ -9,8 +9,8 @@ //! contexts concurrently. Typically, you would have one context per compilation thread and only a //! single ISA instance. -us...
10
24
24
dfdc1ed514142cc16b0100fb2883e8d2bca60e9a
Jakob Stoklund Olesen
2017-03-20T22:14:51
Move ABI boundary legalization into a sub-module. Keep things organized.
diff --git a/lib/cretonne/src/legalizer.rs b/lib/cretonne/src/legalizer/boundary.rs similarity index 79% rename from lib/cretonne/src/legalizer.rs rename to lib/cretonne/src/legalizer/boundary.rs index 88bf0c9ac..1dc638a08 100644 --- a/lib/cretonne/src/legalizer.rs +++ b/lib/cretonne/src/legalizer/boundary.rs @@ -1,106...
2
116
92
34e5675d1716ade8fe8500dc48abeb135a18afab
Jakob Stoklund Olesen
2017-03-20T21:47:09
Add OpcodeConstraints::value_argument_constraint(). As discussed in #3. Once we know the controlling type variable of a polymorphic instruction, the types of input operands are either bound to known types, or they can vary freely.
diff --git a/lib/cretonne/src/ir/instructions.rs b/lib/cretonne/src/ir/instructions.rs index 58801ce85..fe7679121 100644 --- a/lib/cretonne/src/ir/instructions.rs +++ b/lib/cretonne/src/ir/instructions.rs @@ -397,7 +397,7 @@ pub struct OpcodeConstraints { /// Offset into `OPERAND_CONSTRAINT` table of the descrip...
1
51
17
d383a4185107271e40ff57d224fb48c082a5b9a6
Angus Holder
2017-03-20T11:07:50
Verify that all predecessors to an EBB are valid branches, and have the EBB recorded as a successor.
diff --git a/lib/cretonne/src/ir/jumptable.rs b/lib/cretonne/src/ir/jumptable.rs index 69a44ef8f..e7f98a329 100644 --- a/lib/cretonne/src/ir/jumptable.rs +++ b/lib/cretonne/src/ir/jumptable.rs @@ -72,6 +72,11 @@ impl JumpTableData { .enumerate()) } + /// Checks if any of the entries branc...
2
43
2
8b300a9efbeb96d795d228685fc6eec423383fd2
Angus Holder
2017-03-20T10:02:06
Verify that values are defined by an EBB/instruction that dominates the instruction that uses them.
diff --git a/lib/cretonne/src/dominator_tree.rs b/lib/cretonne/src/dominator_tree.rs index 17bd3445a..a426fedbe 100644 --- a/lib/cretonne/src/dominator_tree.rs +++ b/lib/cretonne/src/dominator_tree.rs @@ -68,8 +68,20 @@ impl DominatorTree { /// is unreachable. /// /// An instruction is considered to domi...
2
38
6
c50bf2aa68dcbf5d952d2d0fc979ad2061d4678c
Angus Holder
2017-03-14T20:13:44
Verify that values have a valid reference to either an instruction inserted in an EBB, or an EBB inserted in the layout.
diff --git a/lib/cretonne/src/verifier.rs b/lib/cretonne/src/verifier.rs index f63db1919..ddddb9c50 100644 --- a/lib/cretonne/src/verifier.rs +++ b/lib/cretonne/src/verifier.rs @@ -18,9 +18,9 @@ //! //! SSA form //! -//! TODO: //! - Values must be defined by an instruction that exists and that is inserted in ...
1
38
7
56d12b14ff05b4be0094d095b765f037aeedd633
Jakob Stoklund Olesen
2017-03-16T23:54:26
Add attach_secondary_result and append_secondary_result. These low-level functions allow us to build up a list of instruction results incrementally. They are equivalent to the existing attach_ebb_arg and append_ebb_arg.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index a1eb864af..8977cc675 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -455,6 +455,63 @@ impl DataFlowGraph { panic!("{} is not a secondary result value", value); } + /// Attach an existing value as a...
1
57
0
6dc11d12670941265ee66dff186c382fee7c974d
Jakob Stoklund Olesen
2017-03-16T21:42:41
Use a closure to control the convert_from_abi() function. This will be used for converting function return types soon, so generalize it a bit.
diff --git a/lib/cretonne/src/legalizer.rs b/lib/cretonne/src/legalizer.rs index d6894321f..6814e3fe2 100644 --- a/lib/cretonne/src/legalizer.rs +++ b/lib/cretonne/src/legalizer.rs @@ -146,12 +146,16 @@ fn legalize_entry_arguments(func: &mut Function, entry: Ebb) { abi_arg += 1; } else { ...
1
47
40
e90e59cedb1a7f6f3ee182c877a92535586db891
Jakob Stoklund Olesen
2017-03-16T00:04:58
Add DataFlowGraph::redefine_first_value() This makes it possible to compute the first result of an instruction in a different way without overwriting the original instruction with replace().
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 5a70c9260..a1eb864af 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -5,7 +5,7 @@ use ir::entities::ExpandedValue; use ir::instructions::{Opcode, InstructionData, CallInfo}; use ir::extfunc::ExtFuncData; use entity...
1
47
2
db5aead1a5dca6ca6e87a9b6caab5622148abd03
Jakob Stoklund Olesen
2017-03-15T22:21:57
Rename take_ebb_args to detach_ebb_args() This better matches the detach_secondary_results cousin. Also rename the converse put_ebb_arg -> attach_ebb_arg.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 699f2a2f1..1b1ff418e 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -549,7 +549,7 @@ impl DataFlowGraph { num: 0, next: None.into(), ...
2
11
11
01cb51ece97e493a555e7c7af16924fe1091bd52
Jakob Stoklund Olesen
2017-03-15T20:40:58
Add DataFlowGraph::display_inst(). This method returns an object that can display an instruction in the standard textual format, but without any encoding annotations.
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index c94458203..699f2a2f1 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -8,7 +8,9 @@ use entity_map::{EntityMap, PrimaryEntityData}; use ir::builder::{InsertBuilder, ReplaceBuilder}; use ir::layout::Cursor; use packed...
2
80
43
98e8a964127680dd9379d524a4d3294c538ddbee
Keith Yeung
2017-03-14T18:17:20
Add unit test for value aliasing
diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs index 9f29e5409..414dd291e 100644 --- a/lib/reader/src/parser.rs +++ b/lib/reader/src/parser.rs @@ -1638,6 +1638,25 @@ mod tests { assert_eq!(message, "expected argument type"); } + #[test] + fn aliases() { + let (func, detail...
1
19
0
f18eddc9eddf87de7f1fde9b4245b4f801930613
Keith Yeung
2017-03-14T17:25:30
Allow type inference to go through value aliasing
diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs index 21de8bcda..9f29e5409 100644 --- a/lib/reader/src/parser.rs +++ b/lib/reader/src/parser.rs @@ -1299,13 +1299,20 @@ impl<'a> Parser<'a> { let ctrl_src_value = inst_data.typevar_operand(&ctx.function.dfg.value_lists) ...
1
14
7
d93c37a826222b958a50aa20839b97036f83c28d
Keith Yeung
2017-01-17T09:17:29
Make value aliases during references rewriting
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index f5d48ad81..c94458203 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -234,6 +234,19 @@ impl DataFlowGraph { panic!("Cannot change direct value {} into an alias", dest); } } + + /// Create...
2
31
0
8e38c7907d281511aedc16df3e284593b0add957
Keith Yeung
2017-03-14T04:29:22
Create alias HashMap in parser context
diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs index 7c310cbf1..858049efc 100644 --- a/lib/reader/src/parser.rs +++ b/lib/reader/src/parser.rs @@ -5,6 +5,7 @@ // // ====--------------------------------------------------------------------------------------====// +use std::collections::HashMap; use...
1
13
1
50e043477ee1104c2abb482823eb44c1a1b7c5d5
Keith Yeung
2017-01-09T02:58:12
Parse instruction results separately from instructions
diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs index 44b72afc4..7c310cbf1 100644 --- a/lib/reader/src/parser.rs +++ b/lib/reader/src/parser.rs @@ -979,7 +979,26 @@ impl<'a> Parser<'a> { Some(Token::LBracket) => true, _ => false, } { - sel...
1
49
10
477fb4d5da12b5af4d128439cd030696b6489c1a
Angus Holder
2017-03-13T21:51:16
Expanded instruction integrity checking in the verifier, now verifying result types and entity references.
diff --git a/lib/cretonne/src/entity_list.rs b/lib/cretonne/src/entity_list.rs index 423b0ed15..1a05464c2 100644 --- a/lib/cretonne/src/entity_list.rs +++ b/lib/cretonne/src/entity_list.rs @@ -233,6 +233,12 @@ impl<T: EntityRef> EntityList<T> { pool.len_of(self).unwrap_or(0) } + /// Returns `true` if...
3
152
3
d3df198747dbe5b320ec2f09962628bc51bc1036
Jakob Stoklund Olesen
2017-03-13T23:37:48
Add a grow_at() method to EntityList. This method opens up a hole in the middle of a list where new elements can be written.
diff --git a/lib/cretonne/src/entity_list.rs b/lib/cretonne/src/entity_list.rs index 64a0a4c83..423b0ed15 100644 --- a/lib/cretonne/src/entity_list.rs +++ b/lib/cretonne/src/entity_list.rs @@ -311,6 +311,41 @@ impl<T: EntityRef> EntityList<T> { } } + /// Grow list by adding `count` uninitialized elem...
1
86
0
1e1a1a87973f4e1458abfcd44d07e2ca110da2b7
Angus Holder
2017-03-12T15:20:06
Added ControlFlowGraph::recompute_ebb for incremental CFG updates.
diff --git a/lib/cretonne/src/cfg.rs b/lib/cretonne/src/cfg.rs index c3cf19efe..f445d2c8f 100644 --- a/lib/cretonne/src/cfg.rs +++ b/lib/cretonne/src/cfg.rs @@ -27,6 +27,7 @@ use ir::{Function, Inst, Ebb}; use ir::instructions::BranchInfo; use entity_map::{EntityMap, Keys}; use std::collections::HashSet; +use std::m...
1
97
33
46525b0153565e4b297f727cc48179af34eb17ad
Davide Italiano
2017-03-10T19:52:11
[B-tree] Initial comment to describe the design choices.
diff --git a/lib/cretonne/src/btree.rs b/lib/cretonne/src/btree.rs index cd34c466b..b6732788f 100644 --- a/lib/cretonne/src/btree.rs +++ b/lib/cretonne/src/btree.rs @@ -1,3 +1,16 @@ +//! Generic B-Tree implementation. +//! +//! This module defines a `Btree<K, V>` type which provides similar functionality to +//! `Btree...
1
13
0
4ad8362e09b4bf3f542cdf50920429664bf8c692
Davide Italiano
2017-03-10T17:04:41
Initial B-tree interface.
diff --git a/lib/cretonne/src/btree.rs b/lib/cretonne/src/btree.rs new file mode 100644 index 000000000..cd34c466b --- /dev/null +++ b/lib/cretonne/src/btree.rs @@ -0,0 +1,98 @@ +use std::marker::PhantomData; + +// A Node reference is a direct index to an element of the pool. +type NodeRef = u32; + +/// A B-tree data s...
1
98
0
20d6713f93e4df4218ab3a5a3b039ca57c769a43
Angus Holder
2017-03-09T12:09:28
Some refactoring, relaxed error handling so we allow encoding specifiers even without a unique ISA.
diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs index 7427139a4..b83f8c0b3 100644 --- a/lib/reader/src/parser.rs +++ b/lib/reader/src/parser.rs @@ -504,16 +504,6 @@ impl<'a> Parser<'a> { } } - // Match and consume a name. - fn match_name(&mut self, err_msg: &str) -> Result<&'a str...
1
39
45
e0f7243523bca0fb34a71d7f501899162d5ccaf1
Jakob Stoklund Olesen
2017-03-09T03:43:24
Handle a half-full func.locations map. If func.locations has not been properly resized to have an entry for all values, we should just full in the default location for the missing values instead of crashing.
diff --git a/lib/cretonne/src/write.rs b/lib/cretonne/src/write.rs index 40b625d6e..b0ef3a03d 100644 --- a/lib/cretonne/src/write.rs +++ b/lib/cretonne/src/write.rs @@ -186,7 +186,9 @@ fn write_instruction(w: &mut Write, if !func.locations.is_empty() { let regs = isa.register_info(); ...
1
3
1
a58ccb112524802c82de74cb3da594ebd9caf6ee
Angus Holder
2017-03-03T00:06:52
Added parsing of instruction encodings and result registers specifications.
diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs index bd6fd8fce..f2061afec 100644 --- a/lib/reader/src/parser.rs +++ b/lib/reader/src/parser.rs @@ -6,7 +6,7 @@ // ====--------------------------------------------------------------------------------------====// use std::str::FromStr; -use std::u32; +...
1
132
13
5ac57220bee89e4921d57e5a23ab4bed63ee98cc
Jakob Stoklund Olesen
2017-03-08T20:14:27
Strip trailing white space from regex: directives. This was particularly confusing when reading a file with Windows line endings. The CR would become part of the regex.
diff --git a/lib/filecheck/src/checker.rs b/lib/filecheck/src/checker.rs index 2474742fb..3101865e7 100644 --- a/lib/filecheck/src/checker.rs +++ b/lib/filecheck/src/checker.rs @@ -71,7 +71,8 @@ impl Directive { var, rest))); ...
1
5
2
2de210ddb61d44bc3916927c8e0fbd6b980d246a
Jakob Stoklund Olesen
2017-03-07T23:13:55
Implement From traits on ArgAction for convenience.
diff --git a/lib/cretonne/src/abi.rs b/lib/cretonne/src/abi.rs index 8d02de4ac..d011311e7 100644 --- a/lib/cretonne/src/abi.rs +++ b/lib/cretonne/src/abi.rs @@ -23,6 +23,18 @@ pub enum ArgAction { Convert(ValueConversion), } +impl From<ArgumentLoc> for ArgAction { + fn from(x: ArgumentLoc) -> ArgAction { + ...
2
18
10
77492aa4637f22740bfc1ed6f396d4098d03d03f
Jakob Stoklund Olesen
2017-03-06T22:51:59
Add take_ebb_args(), put_ebb_arg() method pair. These two methods can be use to rewrite the argument values to an EBB. In particular, we need to rewrite the arguments to the entry block to be compatible with a legalized function signature. Reuse the put_ebb_arg() method in the implementation of append_ebb_arg().
diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/cretonne/src/ir/dfg.rs index 94117095a..593d3a790 100644 --- a/lib/cretonne/src/ir/dfg.rs +++ b/lib/cretonne/src/ir/dfg.rs @@ -505,36 +505,13 @@ impl DataFlowGraph { /// Append an argument with type `ty` to `ebb`. pub fn append_ebb_arg(&mut self, ebb: Ebb, ty: T...
1
86
25
07f459fb93a03ce6ac9689be0822d5355d80f18f
Jakob Stoklund Olesen
2017-03-01T19:53:52
Add a legalize_signature method to TargetIsa. This entry point will be used for controlling ABI conventions when legalizing. Provide an empty implementation for RISC-V and let the other ISAs crash in legalization. This is just the scaffolding. We still need to: - Rewrite the entry block arguments to match the legal...
diff --git a/lib/cretonne/src/ir/function.rs b/lib/cretonne/src/ir/function.rs index b1ae83dc2..b0115a70e 100644 --- a/lib/cretonne/src/ir/function.rs +++ b/lib/cretonne/src/ir/function.rs @@ -64,11 +64,6 @@ impl Function { pub fn new() -> Function { Self::with_name_signature(FunctionName::default(), Sign...
5
54
7
cae4368a8adb9b51d2973be6534d0a691b4af482
Jakob Stoklund Olesen
2017-03-03T18:34:29
Use ISA information to display function signatures. The argument locations contains register unit references that we want to display with their correct names.
diff --git a/lib/cretonne/src/ir/extfunc.rs b/lib/cretonne/src/ir/extfunc.rs index 5c4d1d1c7..9f81d1144 100644 --- a/lib/cretonne/src/ir/extfunc.rs +++ b/lib/cretonne/src/ir/extfunc.rs @@ -6,8 +6,9 @@ //! This module declares the data types used to represent external functions and call signatures. use ir::{Type, Fu...
4
77
29
99c7e18fbf0199f58520dfaf4e1e5e4c20174c0e
Jakob Stoklund Olesen
2017-03-03T18:12:49
Add {ValueLoc,ArgumentLoc}::display(). These functions return an object containing the necessary ISA info to print a ValueLoc or ArgumentLoc correctly.
diff --git a/lib/cretonne/src/ir/valueloc.rs b/lib/cretonne/src/ir/valueloc.rs index ea7dea39d..db1ee2baf 100644 --- a/lib/cretonne/src/ir/valueloc.rs +++ b/lib/cretonne/src/ir/valueloc.rs @@ -3,8 +3,9 @@ //! The register allocator assigns every SSA value to either a register or a stack slot. This //! assignment is r...
2
62
7
51702191257e10cc8d18bd583590a66bc9bf4a61
Davide Italiano
2017-02-28T20:39:50
[EntityList] Fix typo. No functional change.
diff --git a/lib/cretonne/src/entity_list.rs b/lib/cretonne/src/entity_list.rs index d94795c90..b2c75bd9e 100644 --- a/lib/cretonne/src/entity_list.rs +++ b/lib/cretonne/src/entity_list.rs @@ -16,7 +16,7 @@ //! Entity lists are not as safe to use as `Vec<T>`, but they never jeopardize Rust's memory safety //! guarant...
1
1
1
0bc27fca9a19d9aa84b32f81e00ebaf9023679f7
rep-nop
2017-02-26T05:14:05
Fixes error on propagating a Result<()> with the `?` operator
diff --git a/lib/cretonne/src/settings.rs b/lib/cretonne/src/settings.rs index 5ffe5dc6a..23ff7d688 100644 --- a/lib/cretonne/src/settings.rs +++ b/lib/cretonne/src/settings.rs @@ -117,7 +117,9 @@ impl Configurable for Builder { let (offset, detail) = self.lookup(name)?; match detail { De...
1
3
1
9f00a40b5277bc92c293210f58d18141d7304ac6
rep-nop
2017-02-26T04:56:16
Ran rustfmt
diff --git a/lib/filecheck/src/explain.rs b/lib/filecheck/src/explain.rs index 825f16207..75fe6f928 100644 --- a/lib/filecheck/src/explain.rs +++ b/lib/filecheck/src/explain.rs @@ -112,11 +112,11 @@ impl<'a> Display for Explainer<'a> { // Emit the match message itself. writeln!(f, - ...
2
7
7
af3f4703b99653c271e7ef28bcba81e5d7c2b869
rep-nop
2017-02-26T03:21:03
Fixes formatting for settings.rs
diff --git a/lib/cretonne/src/settings.rs b/lib/cretonne/src/settings.rs index 0d81c38dc..5ffe5dc6a 100644 --- a/lib/cretonne/src/settings.rs +++ b/lib/cretonne/src/settings.rs @@ -124,7 +124,7 @@ impl Configurable for Builder { } Detail::Enum { last, enumerators } => { self.b...
1
1
1
cf7a729dc1dd4d2b0e29d6fe1d710af3035de1e9
Jakob Stoklund Olesen
2017-02-24T20:04:46
Add an ArgumentLoc data type. This will be used to amend function signatures with ABI lowering information.
diff --git a/lib/cretonne/src/ir/mod.rs b/lib/cretonne/src/ir/mod.rs index f4b2a337b..c14473e9f 100644 --- a/lib/cretonne/src/ir/mod.rs +++ b/lib/cretonne/src/ir/mod.rs @@ -23,7 +23,7 @@ pub use ir::entities::{Ebb, Inst, Value, StackSlot, JumpTable, FuncRef, SigRef}; pub use ir::instructions::{Opcode, InstructionData,...
2
35
1
db9e4ea9791cd5d8f1b46b1eae4795463d5d5503
Jakob Stoklund Olesen
2017-02-24T18:33:08
Convert try! to ? in extfunc.rs
diff --git a/lib/cretonne/src/ir/extfunc.rs b/lib/cretonne/src/ir/extfunc.rs index a47ff4ad7..ae012e753 100644 --- a/lib/cretonne/src/ir/extfunc.rs +++ b/lib/cretonne/src/ir/extfunc.rs @@ -34,9 +34,9 @@ fn write_list(f: &mut Formatter, args: &Vec<ArgumentType>) -> fmt::Result { match args.split_first() { ...
1
11
11
65efefff3868efc29eac87850d2919f064ea39bb
Angus Holder
2017-02-23T01:29:32
Shortened comment to pass lint.
diff --git a/lib/reader/src/lexer.rs b/lib/reader/src/lexer.rs index 474b8d04e..caf32ed25 100644 --- a/lib/reader/src/lexer.rs +++ b/lib/reader/src/lexer.rs @@ -230,7 +230,7 @@ impl<'a> Lexer<'a> { self.next_ch(); if let Some(c) = self.lookahead { - // If the next character wo...
1
1
1
54a53b7ab733e71f916bb7073a49b6ddebb51a73
Angus Holder
2017-02-23T01:07:25
Added tests, some fixes.
diff --git a/lib/reader/src/lexer.rs b/lib/reader/src/lexer.rs index 7e33e8ecd..474b8d04e 100644 --- a/lib/reader/src/lexer.rs +++ b/lib/reader/src/lexer.rs @@ -7,6 +7,7 @@ use std::str::CharIndices; use std::u16; +use std::ascii::AsciiExt; use cretonne::ir::types; use cretonne::ir::{Value, Ebb}; use error::Loca...
1
30
7
a08e1775951e5861fbe2ab3a7bf74f51bff34591
Angus Holder
2017-02-23T00:28:19
Lexer can now scan names, hex sequences, brackets and minus signs.
diff --git a/lib/reader/src/lexer.rs b/lib/reader/src/lexer.rs index 04801b264..7e33e8ecd 100644 --- a/lib/reader/src/lexer.rs +++ b/lib/reader/src/lexer.rs @@ -22,6 +22,9 @@ pub enum Token<'a> { RPar, // ')' LBrace, // '{' RBrace, // '}' + LBracket, // '[' + RBracket, // ']' + Minus, // '-' ...
1
49
0
247be5704282a2759816c0df4a31edab175f38f2
Jakob Stoklund Olesen
2017-02-22T19:41:30
Also write out register assignments in write_instruction. The value locations appear after the encodings: > [R#0c,%x2] v0 = iadd vx0, vx1 > [Iret#19] return_reg v0
diff --git a/lib/cretonne/src/write.rs b/lib/cretonne/src/write.rs index cb5fb8a24..933ba8822 100644 --- a/lib/cretonne/src/write.rs +++ b/lib/cretonne/src/write.rs @@ -4,7 +4,7 @@ //! equivalent textual representation. This textual representation can be read back by the //! `cretonne-reader` crate. -use ir::{Funct...
1
14
2
bf9cf09622d980ebc992ec4e02e7e55a3ae2549a
Jakob Stoklund Olesen
2017-02-17T18:55:47
Add a register allocation context module. Collect the data structures that hang around between function compilations. Provide a main entry point to the register allocator passes.
diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs index 31a1569d5..ce1e8b50f 100644 --- a/lib/cretonne/src/context.rs +++ b/lib/cretonne/src/context.rs @@ -3,10 +3,18 @@ //! When compiling many small functions, it is important to avoid repeatedly allocating and //! deallocating the data structure...
4
83
1
8e421d666d184a2962a005191957d1abf91c36de
Jakob Stoklund Olesen
2017-02-15T21:26:52
SSA register coloring pass. This is a bare-bones outline of the SSA coloring pass. Many features are missing, including: - Handling instruction operand constraints beyond simple register classes. - Handling ABI requirements for function arguments and return values. - Generating shuffle code for EBB arguments.
diff --git a/lib/cretonne/src/isa/constraints.rs b/lib/cretonne/src/isa/constraints.rs index 43a0ddb27..2b8700ec4 100644 --- a/lib/cretonne/src/isa/constraints.rs +++ b/lib/cretonne/src/isa/constraints.rs @@ -49,6 +49,7 @@ pub enum ConstraintKind { } /// Constraints for an encoding recipe. +#[derive(Clone)] pub st...
3
339
0
b2a3b3402228691a8b0c9cdcdc1d2fb61b2ce088
Angus Holder
2017-02-22T18:07:14
Add assertion that the NonZero optimization works on Option<Opcode>.
diff --git a/lib/cretonne/src/ir/instructions.rs b/lib/cretonne/src/ir/instructions.rs index 216e88b88..839219fc2 100644 --- a/lib/cretonne/src/ir/instructions.rs +++ b/lib/cretonne/src/ir/instructions.rs @@ -736,6 +736,8 @@ mod tests { #[test] fn opcodes() { + use std::mem; + let x = Opcode...
1
8
0
41ca00df8dbdb5a2e2d16e8297917192f84dec10
Angus Holder
2017-02-22T17:07:07
Fix test case that I missed before.
diff --git a/lib/cretonne/src/ir/instructions.rs b/lib/cretonne/src/ir/instructions.rs index 73d49e724..216e88b88 100644 --- a/lib/cretonne/src/ir/instructions.rs +++ b/lib/cretonne/src/ir/instructions.rs @@ -742,7 +742,7 @@ mod tests { assert!(x != y); y = Opcode::Iadd; assert_eq!(x, y); - ...
1
1
1
22bc33fa059cc920251bef994e25492831f7b0b0
Jakob Stoklund Olesen
2017-02-18T18:22:27
Create live ranges for dead defs. When the liveness pass implements dead code elimination, missing live ranges can be used to indicate unused values that it may be possible to remove. But even then, we may have to keep dead defs around if the instruction has side effects or other live defs.
diff --git a/lib/cretonne/src/regalloc/liveness.rs b/lib/cretonne/src/regalloc/liveness.rs index da4b2568f..a8591e859 100644 --- a/lib/cretonne/src/regalloc/liveness.rs +++ b/lib/cretonne/src/regalloc/liveness.rs @@ -304,6 +304,13 @@ impl Liveness { // TODO: Resolve value aliases while we're visiting instructi...
1
7
0
a20afbefe0d65ae140069c2996f530ed1452e95d
Jakob Stoklund Olesen
2017-02-18T18:22:00
Improve assertion text for missing live ranges.
diff --git a/lib/cretonne/src/regalloc/live_value_tracker.rs b/lib/cretonne/src/regalloc/live_value_tracker.rs index 838c5b6bb..bcbbb62fe 100644 --- a/lib/cretonne/src/regalloc/live_value_tracker.rs +++ b/lib/cretonne/src/regalloc/live_value_tracker.rs @@ -229,7 +229,10 @@ impl LiveValueTracker { // Add the va...
1
4
1
85fa68023c07fb23b7d58384a9afe92f4b46ec4b
Jakob Stoklund Olesen
2017-02-17T21:09:41
Make the DominatorTree reusable. Add a compute() method which can recompute a dominator tree for different functions. Add a dominator tree data to the cretonne::Context.
diff --git a/cranelift/src/filetest/domtree.rs b/cranelift/src/filetest/domtree.rs index 72a4293df..efa4ee857 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
37
14
fa205d049dcb13d271839b34a61b4fa8f2c23de3
Jakob Stoklund Olesen
2017-02-17T21:09:41
Make the DominatorTree reusable. Add a compute() method which can recompute a dominator tree for different functions. Add a dominator tree data to the cretonne::Context.
diff --git a/lib/cretonne/src/context.rs b/lib/cretonne/src/context.rs index 8a94dd83f..31a1569d5 100644 --- a/lib/cretonne/src/context.rs +++ b/lib/cretonne/src/context.rs @@ -5,6 +5,7 @@ //! on to memory allocations between function compilations. use cfg::ControlFlowGraph; +use dominator_tree::DominatorTree; use...
3
37
14
77a7ad88f4a3ad36079040d021488f67e8d87820
Jakob Stoklund Olesen
2017-02-17T20:16:48
Make the ControlFlowGraph reusable. Move the flow graph computation into a compute method which can be called with multiple functions. This allows us to reuse the ControlFlowGraph memory and keep an instance in the Context.
diff --git a/cranelift/src/filetest/domtree.rs b/cranelift/src/filetest/domtree.rs index 0a570e325..72a4293df 100644 --- a/cranelift/src/filetest/domtree.rs +++ b/cranelift/src/filetest/domtree.rs @@ -40,7 +40,7 @@ impl SubTest for TestDomtree { // Extract our own dominator tree from fn run(&self, func: Cow<F...
6
39
19
0f29fc7a526ea561f0e1180e6e2fb050529859f8
Jakob Stoklund Olesen
2017-02-17T20:16:48
Make the ControlFlowGraph reusable. Move the flow graph computation into a compute method which can be called with multiple functions. This allows us to reuse the ControlFlowGraph memory and keep an instance in the Context.
diff --git a/lib/cretonne/src/cfg.rs b/lib/cretonne/src/cfg.rs index cfb29844d..9b0f3f15e 100644 --- a/lib/cretonne/src/cfg.rs +++ b/lib/cretonne/src/cfg.rs @@ -50,31 +50,44 @@ pub struct ControlFlowGraph { } impl ControlFlowGraph { - /// During initialization mappings will be generated for any existing - ///...
6
39
19
f3fa0fb4e991ca421a55c4e5b63d8baa3b9f7ba6
Jakob Stoklund Olesen
2017-02-17T20:05:27
Return slices instead of &Vec references. We Don't need to expose the internal control flow graph representation.
diff --git a/lib/cretonne/src/cfg.rs b/lib/cretonne/src/cfg.rs index 546635581..cfb29844d 100644 --- a/lib/cretonne/src/cfg.rs +++ b/lib/cretonne/src/cfg.rs @@ -83,12 +83,12 @@ impl ControlFlowGraph { } /// Get the CFG predecessor basic blocks to `ebb`. - pub fn get_predecessors(&self, ebb: Ebb) -> &Vec<...
1
2
2