Skip to content

Commit 9299d10

Browse files
authored
Merge pull request #45 from A-Mavericks/main
2 parents 8656ca8 + 81ddcb0 commit 9299d10

33 files changed

+2876530
-94
lines changed

collector/src/mir_analyze/mir/mir.lalrpop

Lines changed: 345 additions & 89 deletions
Large diffs are not rendered by default.

collector/src/mir_analyze/mir/oop_pattern.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,6 @@ pub fn dfc(mir_file: &MIRs) -> i32 {
187187
let depths_count = depths.len();
188188
let depths_sum: usize = depths.values().sum();
189189

190-
if funcname_call_count == 0 {
191-
return 0;
192-
}
193-
194190
let result = funcname_call_count - depths_count + depths_sum / funcname_call_count;
195191
// println!("Result: {}", result);
196192
result as i32

collector/src/mir_analyze/mir/place.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
use super::{mir::LocalID, mir::ModuledIdentifier, ty::Ty};
1+
use super::{
2+
mir::{LocalID, ModuledIdentifier},
3+
operand::Operand,
4+
ty::Ty,
5+
};
26
use std::str::FromStr;
37

48
#[derive(Debug)]

collector/src/mir_analyze/mir/reader.rs

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,138 @@ pub const TEST_FILES: [TestFile; 46] = [
214214
},
215215
];
216216

217+
pub const TEST_RUSTC: [TestFile; 28] = [
218+
TestFile {
219+
name: "encoding",
220+
path: "test/rustperf/encoding.mir",
221+
},
222+
TestFile {
223+
name: "rayon",
224+
path: "test/rustperf/rayon.mir",
225+
},
226+
TestFile {
227+
name: "unicode",
228+
path: "test/rustperf/unicode.mir",
229+
},
230+
/*TestFile {
231+
name: "tuple_stress",
232+
path: "test/rustperf/tuple_stress.mir",
233+
},*/
234+
TestFile {
235+
name: "piston_image",
236+
path: "test/rustperf/piston_image.mir",
237+
},
238+
/*TestFile {
239+
name: "cranelift",
240+
path: "test/rustperf/cranelift.mir",
241+
},
242+
243+
TestFile {
244+
name: "diesel",
245+
path: "test/rustperf/diesel.mir",
246+
},*/
247+
TestFile {
248+
name: "wg_grammer",
249+
path: "test/rustperf/wg_grammer.mir",
250+
},
251+
TestFile {
252+
name: "many_assoc",
253+
path: "test/rustperf/many_assoc.mir",
254+
},
255+
TestFile {
256+
name: "serde",
257+
path: "test/rustperf/serde.mir",
258+
},
259+
TestFile {
260+
name: "serde_drive",
261+
path: "test/rustperf/serde_drive.mir",
262+
},
263+
/*TestFile {
264+
name: "coercions",
265+
path: "test/rustperf/coercions.mir",
266+
},*/
267+
TestFile {
268+
name: "regress",
269+
path: "test/rustperf/regress.mir",
270+
},
271+
TestFile {
272+
name: "regex",
273+
path: "test/rustperf/regex.mir",
274+
},
275+
TestFile {
276+
name: "match_stress",
277+
path: "test/rustperf/match_stress.mir",
278+
},
279+
TestFile {
280+
name: "exa",
281+
path: "test/rustperf/exa.mir",
282+
},
283+
TestFile {
284+
name: "libc",
285+
path: "test/rustperf/libc.mir",
286+
},
287+
TestFile {
288+
name: "html5ever2",
289+
path: "test/rustperf/html5ever2.mir",
290+
},
291+
TestFile {
292+
name: "html5ever",
293+
path: "test/rustperf/html5ever.mir",
294+
},
295+
TestFile {
296+
name: "clap",
297+
path: "test/rustperf/clap.mir",
298+
},
299+
TestFile {
300+
name: "await-call-tree",
301+
path: "test/rustperf/await_call_tree.mir",
302+
},
303+
TestFile {
304+
name: "deeply_nested_multi",
305+
path: "test/rustperf/deeply_nested_multi.mir",
306+
},
307+
TestFile {
308+
name: "issue_1",
309+
path: "test/rustperf/issue_1.mir",
310+
},
311+
TestFile {
312+
name: "projection_caching",
313+
path: "test/rustperf/projection_caching.mir",
314+
},
315+
TestFile {
316+
name: "wf_projection",
317+
path: "test/rustperf/wf_projection.mir",
318+
},
319+
TestFile {
320+
name: "tt_munther",
321+
path: "test/rustperf/tt_munther.mir",
322+
},
323+
TestFile {
324+
name: "webpush",
325+
path: "test/rustperf/webpush.mir",
326+
},
327+
TestFile {
328+
name: "token_stream",
329+
path: "test/rustperf/token_stream.mir",
330+
},
331+
TestFile {
332+
name: "issue_2",
333+
path: "test/rustperf/issue_2.mir",
334+
},
335+
TestFile {
336+
name: "inflate",
337+
path: "test/rustperf/inflate.mir",
338+
},
339+
TestFile {
340+
name: "syn_1",
341+
path: "test/rustperf/syn_1.mir",
342+
},
343+
TestFile {
344+
name: "syn_2",
345+
path: "test/rustperf/syn_2.mir",
346+
},
347+
];
348+
217349
fn run_test(file_path: &str) {
218350
let test_file = File::open(file_path).unwrap();
219351
let result = parse_mir(test_file).unwrap();
@@ -228,3 +360,18 @@ fn test_files() {
228360
println!();
229361
}
230362
}
363+
364+
#[test]
365+
fn test_rustc() {
366+
for test_file in TEST_RUSTC.iter() {
367+
println!("Running test for {}", test_file.name);
368+
run_test(test_file.path);
369+
println!();
370+
}
371+
}
372+
373+
#[test]
374+
fn test_dev() {
375+
run_test("test/mir_analyze/mir/dev.mir");
376+
println!();
377+
}

0 commit comments

Comments
 (0)