Class: Kumi::IR::Loop::Passes::Support::Nest
- Inherits:
-
Object
- Object
- Kumi::IR::Loop::Passes::Support::Nest
- Defined in:
- lib/kumi/ir/loop/passes/support/structure.rb
Overview
Structured view of a LoopIR instruction stream: loop_start/loop_end pairs become Nest items so passes can reason about loops as units, then serialize back to the flat form.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#end_node ⇒ Object
readonly
Returns the value of attribute end_node.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
Instance Method Summary collapse
- #axis ⇒ Object
- #elem_reg ⇒ Object
- #index_reg ⇒ Object
-
#initialize(start:, body:, end_node:) ⇒ Nest
constructor
A new instance of Nest.
- #source_reg ⇒ Object
- #with_body(body) ⇒ Object
Constructor Details
#initialize(start:, body:, end_node:) ⇒ Nest
Returns a new instance of Nest.
14 15 16 17 18 |
# File 'lib/kumi/ir/loop/passes/support/structure.rb', line 14 def initialize(start:, body:, end_node:) @start = start @body = body @end_node = end_node end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
12 13 14 |
# File 'lib/kumi/ir/loop/passes/support/structure.rb', line 12 def body @body end |
#end_node ⇒ Object (readonly)
Returns the value of attribute end_node.
12 13 14 |
# File 'lib/kumi/ir/loop/passes/support/structure.rb', line 12 def end_node @end_node end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
12 13 14 |
# File 'lib/kumi/ir/loop/passes/support/structure.rb', line 12 def start @start end |
Instance Method Details
#axis ⇒ Object
20 |
# File 'lib/kumi/ir/loop/passes/support/structure.rb', line 20 def axis = @start.attributes[:axis] |
#elem_reg ⇒ Object
22 |
# File 'lib/kumi/ir/loop/passes/support/structure.rb', line 22 def elem_reg = @start.result |
#index_reg ⇒ Object
23 |
# File 'lib/kumi/ir/loop/passes/support/structure.rb', line 23 def index_reg = @start.attributes[:index] |
#source_reg ⇒ Object
21 |
# File 'lib/kumi/ir/loop/passes/support/structure.rb', line 21 def source_reg = @start.inputs.first |