Commit Graph

9391 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
1d0ab91136 Store instruction encodings in Function.
This is a side-table of ISA-dependent information that will initially be
filled out by the legalizer.
2016-09-20 10:17:16 -07:00
Jakob Stoklund Olesen
7417f884b3 Add clear, is_empty, and resize methods to EntityMap.
These are simply forwards from the underlying Vec.
2016-09-20 10:00:30 -07:00
Jakob Stoklund Olesen
57b6967ddd Add clear, is_empty, and resize methods to EntityMap.
These are simply forwards from the underlying Vec.
2016-09-20 10:00:30 -07:00
Jakob Stoklund Olesen
388154e06b Wrap FunctionName in a newtype struct.
Function names display differently than normal strings since they need
quotes and escaping.

Move the FunctionName type into its own module.
2016-09-19 15:09:25 -07:00
Jakob Stoklund Olesen
af29fee5d2 Wrap FunctionName in a newtype struct.
Function names display differently than normal strings since they need
quotes and escaping.

Move the FunctionName type into its own module.
2016-09-19 15:09:25 -07:00
Jakob Stoklund Olesen
6fb566fa85 Add a TargetIsa::display_enc() method.
The interpretation of an encoding depends on the target ISA, and so does
the proper printing of the encoding.
2016-09-19 13:45:22 -07:00
Jakob Stoklund Olesen
43aa6f66d9 Add a TargetIsa::display_enc() method.
The interpretation of an encoding depends on the target ISA, and so does
the proper printing of the encoding.
2016-09-19 13:45:22 -07:00
Jakob Stoklund Olesen
fb1bc5d096 Move 'Encoding' into its own module. 2016-09-19 13:07:58 -07:00
Jakob Stoklund Olesen
59c404ed29 Move 'Encoding' into its own module. 2016-09-19 13:07:58 -07:00
Jakob Stoklund Olesen
b5ffd3af92 Rename 'encoding' modules to 'enc_tables'.
These modules contain encoding tables, not the 'Encoding' struct.
2016-09-19 13:00:16 -07:00
Jakob Stoklund Olesen
ce6a463267 Rename 'encoding' modules to 'enc_tables'.
These modules contain encoding tables, not the 'Encoding' struct.
2016-09-19 13:00:16 -07:00
Jakob Stoklund Olesen
047bf5ab28 Remove the inst_locs vector in the parser.
Use the source map to track instruction locations instead.

The rewrite methods now take an AnyEntity argument as the location to
use for errors. This means that bad EBB references in jump tables are
now reported correctly.
2016-09-19 11:47:57 -07:00
Jakob Stoklund Olesen
622006ecc5 Remove the inst_locs vector in the parser.
Use the source map to track instruction locations instead.

The rewrite methods now take an AnyEntity argument as the location to
use for errors. This means that bad EBB references in jump tables are
now reported correctly.
2016-09-19 11:47:57 -07:00
Jakob Stoklund Olesen
1a73b4f3f2 Also record locations for tracked entities. 2016-09-19 11:29:55 -07:00
Jakob Stoklund Olesen
d0f9f92317 Also record locations for tracked entities. 2016-09-19 11:29:55 -07:00
Jakob Stoklund Olesen
b5514748a4 Add an internal MutableSourceMap trait.
Use the SourceMap for mapping during parsing too.
2016-09-19 11:13:11 -07:00
Jakob Stoklund Olesen
dd8e7df8ba Add an internal MutableSourceMap trait.
Use the SourceMap for mapping during parsing too.
2016-09-19 11:13:11 -07:00
Jakob Stoklund Olesen
ac46de7200 Extract Result and Error into their own module.
Also include the err! macro and make it usable outside the module.
2016-09-19 10:23:51 -07:00
Jakob Stoklund Olesen
feef2ecf3f Extract Result and Error into their own module.
Also include the err! macro and make it usable outside the module.
2016-09-19 10:23:51 -07:00
Jakob Stoklund Olesen
b5828cb9a3 Print out a report of slow-running tests.
The slow tests are computed as those that would be printed as outliers
on a boxplot of all the test runtimes. These are more than 1.5
inter-quartile range away from the 75% quartile.
2016-09-18 11:35:10 -07:00
Jakob Stoklund Olesen
17c2b5213a Print out a report of slow-running tests.
The slow tests are computed as those that would be printed as outliers
on a boxplot of all the test runtimes. These are more than 1.5
inter-quartile range away from the 75% quartile.
2016-09-18 11:35:10 -07:00
Jakob Stoklund Olesen
67c8ae7f14 Add --verbose flag to cton-util test. 2016-09-17 17:11:17 -07:00
Jakob Stoklund Olesen
5cb5110330 Add --verbose flag to cton-util test. 2016-09-17 17:11:17 -07:00
Jakob Stoklund Olesen
23887358dd Simplify with unwrap_or_else(). 2016-09-17 12:36:35 -07:00
Jakob Stoklund Olesen
b1468ee0bc Simplify with unwrap_or_else(). 2016-09-17 12:36:35 -07:00
Jakob Stoklund Olesen
a4774ce87d Record the location of parsed functions.
Remember the location of the 'function' keyword that starts every
function. This can be useful for reporting test failures etc.
2016-09-17 11:42:08 -07:00
Jakob Stoklund Olesen
aa1da4d871 Record the location of parsed functions.
Remember the location of the 'function' keyword that starts every
function. This can be useful for reporting test failures etc.
2016-09-17 11:42:08 -07:00
Jakob Stoklund Olesen
81f26422fa Tell Travis to cache Cargo intermediate build products.
The CI builds were using a lot of time downloading and building crates.
2016-09-17 11:29:52 -07:00
Jakob Stoklund Olesen
951ff3e6fc Tell Travis to cache Cargo intermediate build products.
The CI builds were using a lot of time downloading and building crates.
2016-09-17 11:29:52 -07:00
Jakob Stoklund Olesen
b2f0dd7da3 Run tests concurrently.
Spin up one worker thread per cpu, and run filetests on all of them. Use
a reorder buffer in Runner to make sure results are still reported in
order.

Individual test files given as command line arguments are still run
synchronously for easier debugging. Only directories are run on worker
threads. The recursive directory traversal is still happening on the
main thread.

Use a heartbeat thread to send ticks on the reply channel every second,
and use the ticks to detect tests that are stuck. When
Receiver::recv_timeout() is stabilized, we can probably get rid of the
heartbeat thread.

Catch panics on the worker threads and report them as test failures.
2016-09-17 10:58:53 -07:00
Jakob Stoklund Olesen
1c1ae524aa Run tests concurrently.
Spin up one worker thread per cpu, and run filetests on all of them. Use
a reorder buffer in Runner to make sure results are still reported in
order.

Individual test files given as command line arguments are still run
synchronously for easier debugging. Only directories are run on worker
threads. The recursive directory traversal is still happening on the
main thread.

Use a heartbeat thread to send ticks on the reply channel every second,
and use the ticks to detect tests that are stuck. When
Receiver::recv_timeout() is stabilized, we can probably get rid of the
heartbeat thread.

Catch panics on the worker threads and report them as test failures.
2016-09-17 10:58:53 -07:00
Jakob Stoklund Olesen
5ea9a43928 Simplify job queue.
Always keep PathBufs for every entry in the test list. When concurrent
testing is enabled, we'll want to clone the path for the worker threads.

Remove the Job struct for the same reason.
2016-09-16 21:50:15 -07:00
Jakob Stoklund Olesen
356e05d225 Simplify job queue.
Always keep PathBufs for every entry in the test list. When concurrent
testing is enabled, we'll want to clone the path for the worker threads.

Remove the Job struct for the same reason.
2016-09-16 21:50:15 -07:00
Jakob Stoklund Olesen
91167f0153 Move the code to run test into its own module.
Loading a file and running the test in it can be separated from the
mechanics of running multiple tests and scanning directories for test
files.
2016-09-16 21:09:37 -07:00
Jakob Stoklund Olesen
c04b2fa793 Move the code to run test into its own module.
Loading a file and running the test in it can be separated from the
mechanics of running multiple tests and scanning directories for test
files.
2016-09-16 21:09:37 -07:00
Jakob Stoklund Olesen
4bc41bbcff Move subtest::new() into the parent module.
This saves on importing of all the sub-modules that implement new test
commands, and it provides a nice overview of what 'cton-util test' can
do.
2016-09-16 17:00:55 -07:00
Jakob Stoklund Olesen
30009356a6 Move subtest::new() into the parent module.
This saves on importing of all the sub-modules that implement new test
commands, and it provides a nice overview of what 'cton-util test' can
do.
2016-09-16 17:00:55 -07:00
Jakob Stoklund Olesen
b26f7be6c9 cargo update. 2016-09-16 16:41:04 -07:00
Jakob Stoklund Olesen
7f1f4175ac cargo update. 2016-09-16 16:41:04 -07:00
Jakob Stoklund Olesen
dd9696e294 Remove unnecessary external dependencies.
The main libcretonne crate should not have any external dependencies if
at all possible. Use simple substring matching instead of regular
expressions in the verifier tests to achieve this.

The tools crate no longer depends directly on glob and regex. It still
has an indirect dependency on regex through libfilecheck.
2016-09-16 16:34:50 -07:00
Jakob Stoklund Olesen
d2e5059ab9 Remove unnecessary external dependencies.
The main libcretonne crate should not have any external dependencies if
at all possible. Use simple substring matching instead of regular
expressions in the verifier tests to achieve this.

The tools crate no longer depends directly on glob and regex. It still
has an indirect dependency on regex through libfilecheck.
2016-09-16 16:34:50 -07:00
Jakob Stoklund Olesen
a98d6e5256 Add a 'test verifier' sub-test.
This test runs the verifier on each function and matches the resulting
verifier error against the "error:" annotation.

Move the existing verifier test into filetests/verifier/ and use the new
syntex.
2016-09-16 16:25:36 -07:00
Jakob Stoklund Olesen
b5b1ee23b5 Add a 'test verifier' sub-test.
This test runs the verifier on each function and matches the resulting
verifier error against the "error:" annotation.

Move the existing verifier test into filetests/verifier/ and use the new
syntex.
2016-09-16 16:25:36 -07:00
Jakob Stoklund Olesen
49202bf21b Add a location to verifier error messages.
The verifier reports the 'location' of an error message as a reference
to the entity that has a problem. This uses the 'AnyEntity' type to
refer to instructions/values/ebbs etc.

Also add an err! macro similar to the one used by the parser.
2016-09-16 15:35:37 -07:00
Jakob Stoklund Olesen
c3afc1f2be Add a location to verifier error messages.
The verifier reports the 'location' of an error message as a reference
to the entity that has a problem. This uses the 'AnyEntity' type to
refer to instructions/values/ebbs etc.

Also add an err! macro similar to the one used by the parser.
2016-09-16 15:35:37 -07:00
Jakob Stoklund Olesen
45559a21c1 Remove dead public functions from DominatorTree. 2016-09-16 15:17:19 -07:00
Jakob Stoklund Olesen
52aca982a1 Remove dead public functions from DominatorTree. 2016-09-16 15:17:19 -07:00
Jakob Stoklund Olesen
770285d5c6 Implement a domtree sub-test.
This test verifies the computed dominator tree against annotations.

Move the existing testcases into filetests/ with the new syntax.
2016-09-16 14:50:32 -07:00
Jakob Stoklund Olesen
4198b2dde5 Implement a domtree sub-test.
This test verifies the computed dominator tree against annotations.

Move the existing testcases into filetests/ with the new syntax.
2016-09-16 14:50:32 -07:00
Jakob Stoklund Olesen
ec6a9df08a Make the source map available as filecheck variables.
This makes it possible to refer to entities defined in the source file,
using the source names prefixed with $.

For example, $v20 refers to the value by that name in the sources, even
if it was renumbered to 'vx0' in the parsed file.
2016-09-16 12:59:05 -07:00