compiler.cfg.stacks.finalize: initial docs
							parent
							
								
									3515a45b84
								
							
						
					
					
						commit
						e968c16139
					
				| 
						 | 
					@ -0,0 +1,28 @@
 | 
				
			||||||
 | 
					USING: assocs compiler.cfg help.markup help.syntax ;
 | 
				
			||||||
 | 
					IN: compiler.cfg.stacks.finalize
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					HELP: inserting-peeks
 | 
				
			||||||
 | 
					{ $values { "from" basic-block } { "to" basic-block } { "assoc" assoc } }
 | 
				
			||||||
 | 
					{ $description
 | 
				
			||||||
 | 
					  "A peek is inserted on an edge if the destination anticipates the stack location, the source does not anticipate it and it is not available from the source in a register." } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					HELP: inserting-replaces
 | 
				
			||||||
 | 
					{ $values { "from" basic-block } { "to" basic-block } { "assoc" assoc } }
 | 
				
			||||||
 | 
					{ $description
 | 
				
			||||||
 | 
					  "A replace is inserted on an edge if two conditions hold:"
 | 
				
			||||||
 | 
					  { $list
 | 
				
			||||||
 | 
					    "the location is not dead at the destination, OR the location is live at the destination but not available at the destination."
 | 
				
			||||||
 | 
					    "the location is pending in the source but not the destination"
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					} ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{ inserting-replaces inserting-peeks } related-words
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					HELP: finalize-stack-shuffling
 | 
				
			||||||
 | 
					{ $values { "cfg" cfg } }
 | 
				
			||||||
 | 
					{ $description "Called to end the stack analysis." } ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ARTICLE: "compiler.cfg.stacks.finalize" "Stack finalization"
 | 
				
			||||||
 | 
					"This pass inserts peeks and replaces." ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ABOUT: "compiler.cfg.stacks.finalize"
 | 
				
			||||||
| 
						 | 
					@ -7,22 +7,12 @@ compiler.cfg.stacks.local compiler.cfg.utilities fry kernel
 | 
				
			||||||
locals make math sequences ;
 | 
					locals make math sequences ;
 | 
				
			||||||
IN: compiler.cfg.stacks.finalize
 | 
					IN: compiler.cfg.stacks.finalize
 | 
				
			||||||
 | 
					
 | 
				
			||||||
! This pass inserts peeks and replaces.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
:: inserting-peeks ( from to -- assoc )
 | 
					:: inserting-peeks ( from to -- assoc )
 | 
				
			||||||
    ! A peek is inserted on an edge if the destination anticipates
 | 
					 | 
				
			||||||
    ! the stack location, the source does not anticipate it and
 | 
					 | 
				
			||||||
    ! it is not available from the source in a register.
 | 
					 | 
				
			||||||
    to anticip-in
 | 
					    to anticip-in
 | 
				
			||||||
    from anticip-out from avail-out assoc-union
 | 
					    from anticip-out from avail-out assoc-union
 | 
				
			||||||
    assoc-diff ;
 | 
					    assoc-diff ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
:: inserting-replaces ( from to -- assoc )
 | 
					:: inserting-replaces ( from to -- assoc )
 | 
				
			||||||
    ! A replace is inserted on an edge if two conditions hold:
 | 
					 | 
				
			||||||
    ! - the location is not dead at the destination, OR
 | 
					 | 
				
			||||||
    !   the location is live at the destination but not available
 | 
					 | 
				
			||||||
    !   at the destination
 | 
					 | 
				
			||||||
    ! - the location is pending in the source but not the destination
 | 
					 | 
				
			||||||
    from pending-out to pending-in assoc-diff
 | 
					    from pending-out to pending-in assoc-diff
 | 
				
			||||||
    to dead-in to live-in to anticip-in assoc-diff assoc-diff
 | 
					    to dead-in to live-in to anticip-in assoc-diff assoc-diff
 | 
				
			||||||
    assoc-diff ;
 | 
					    assoc-diff ;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue