1; REQUIRES: have_tflite 2; REQUIRES: x86_64-linux 3; 4; Check that we log the currently in development features correctly with both the default 5; case and with a learned policy. 6; 7; RUN: llc -o /dev/null -mtriple=x86_64-linux-unknown -regalloc=greedy \ 8; RUN: -regalloc-enable-advisor=development \ 9; RUN: -regalloc-training-log=%t1 \ 10; RUN: -regalloc-enable-development-features < %S/Inputs/input.ll 11; RUN: %python %S/../../../lib/Analysis/models/log_reader.py %t1 > %t1.readable 12; RUN: FileCheck --input-file %t1.readable %s 13 14; RUN: rm -rf %t && mkdir %t 15; RUN: %python %S/../../../lib/Analysis/models/gen-regalloc-eviction-test-model.py %t_savedmodel 16; RUN: %python %S/../../../lib/Analysis/models/saved-model-to-tflite.py %t_savedmodel %t 17; RUN: llc -o /dev/null -mtriple=x86_64-linux-unknown -regalloc=greedy \ 18; RUN: -regalloc-enable-advisor=development \ 19; RUN: -regalloc-training-log=%t2 -regalloc-model=%t \ 20; RUN: -regalloc-enable-development-features < %S/Inputs/input.ll 21; RUN: %python %S/../../../lib/Analysis/models/log_reader.py %t2 > %t2.readable 22; RUN: FileCheck --input-file %t2.readable %s 23 24; CHECK-NOT: nan 25; Check the first five opcodes in the first eviction problem 26; Also, the first eviction problem is significantly less than 300 instructions. Check 27; that there is a zero value. 28; Note: we're regex-ing some of the opcodes to avoid test flakyness. 29; CHECK: instructions: 20,{{([0-9]{4})}},1{{([0-9]{3})}},1{{([0-9]{3})}},{{.*}},0, 30; Only the candidate virtreg and the 10th LR are included in this problem. Make 31; sure the other LRs have values of zero. There are 2700 0s followed by some 1s. 32; There's a limit to how many repetitions can be matched. 33; CHECK: instructions_mapping: {{(((0,){27}){100})}} 34; CHECK-SAME: 1 35; Indexing 300 back from where the candidate vr actual resides due to the fact 36; that not all the values between the 10th LR and the candidate are zero. 37; CHECK-SAME-COUNT-6600: 0, 38; CHECK-SAME: 1 39; Ensure that we can still go through the mapping matrices for the rest of the 40; eviction problems to make sure we haven't hit the end of the matrix above. 41; There are a total of 23 eviction problems with this test. 42; CHECK-LABEL: observation: 16 43; Make sure that we're exporting the mbb_frequencies. Don't actually check 44; values due to all values being floating point/liable to change very easily. 45; CHECK: mbb_frequencies: 46; Make sure that we have the mbb_mapping feature, and that the first couple 47; of values are correct. 48; CHECK: mbb_mapping: 0,0,0,0,1,1,1 49