To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

coloring.rs 568 Bytes
Newer Older
qinsoon's avatar
qinsoon committed
1
2
3
use compiler::backend::reg_alloc::liveness::InterferenceGraph; 
use vm::machine_code::CompiledFunction;

4
5
use compiler::backend::GPR_COUNT;

qinsoon's avatar
qinsoon committed
6
7
8
pub struct GraphColoring <'a> {
    ig: InterferenceGraph,
    cur_cf: &'a CompiledFunction,
9
    K: usize
qinsoon's avatar
qinsoon committed
10
11
12
13
14
15
16
}

impl <'a> GraphColoring <'a> {
    pub fn start (cf: &CompiledFunction, ig: InterferenceGraph) {
        let mut coloring = GraphColoring {
            ig: ig,
            cur_cf: cf, 
17
            K: 0
qinsoon's avatar
qinsoon committed
18
19
20
21
22
23
        };
        
        coloring.init();
    }
    
    fn init (&mut self) {
24
        self.K = GPR_COUNT;
qinsoon's avatar
qinsoon committed
25
26
    }
}