Skip to content

Collision in Register Allocation #300

@Jackcuii

Description

@Jackcuii

We still have some more issues on register allocation problems in our kernel.
Still take the gemm as an example.

- index_per_ii: 11
              operations:
                - opcode: "NOT"
                  id: 159
                  time_step: 11
                  invalid_iterations: 0
                  src_operands:
                    - operand: "$0"
                      color: "RED"
                  dst_operands:
                    - operand: "$3"
                      color: "RED"
                    - operand: "$0"
                      color: "RED"
                    - operand: "$7"
                      color: "RED"
                    - operand: "$6"
                      color: "RED"
                    - operand: "NORTH"
                      color: "RED"
                    - operand: "$5"
                      color: "RED"
                    - operand: "SOUTH"
                      color: "RED"
                    - operand: "WEST"
                      color: "RED"
                - opcode: "DATA_MOV"
                  id: 105
                  time_step: 11
                  invalid_iterations: 0
                  src_operands:
                    - operand: "WEST"
                      color: "RED"
                  dst_operands:
                    - operand: "$0"
                      color: "RED"
                - opcode: "DATA_MOV"
                  id: 1480000
                  time_step: 11
                  invalid_iterations: 0
                  src_operands:
                    - operand: "$3"
                      color: "RED"
                  dst_operands:
                    - operand: "EAST"
                      color: "RED"
            - index_per_ii: 12
              operations:
                - opcode: "GRANT_PREDICATE"
                  id: 158
                  time_step: 12
                  invalid_iterations: 0
                  src_operands:
                    - operand: "$0"
                      color: "RED"
                    - operand: "$1"
                      color: "RED"
                  dst_operands:
                    - operand: "$0"
                      color: "RED"
                - opcode: "DATA_MOV"
                  id: 1780000
                  time_step: 12
                  invalid_iterations: 0
                  src_operands:
                    - operand: "$7"
                      color: "RED"
                  dst_operands:
                    - operand: "WEST"
                      color: "RED"
                - opcode: "DATA_MOV"
                  id: 1770000
                  time_step: 12
                  invalid_iterations: 0
                  src_operands:
                    - operand: "$6"
                      color: "RED"
                  dst_operands:
                    - operand: "SOUTH"
                      color: "RED"
                - opcode: "DATA_MOV"
                  id: 1750000
                  time_step: 12
                  invalid_iterations: 0
                  src_operands:
                    - operand: "$5"
                      color: "RED"
                  dst_operands:
                    - operand: "NORTH"
                      color: "RED"
                - opcode: "DATA_MOV"
                  id: 1460000
                  time_step: 12
                  invalid_iterations: 0
                  src_operands:
                    - operand: "$4"
                      color: "RED"
                  dst_operands:
                    - operand: "EAST"
                      color: "RED"
            - index_per_ii: 13
              operations:
                - opcode: "ADD"
                  id: 182
                  time_step: 13
                  invalid_iterations: 0
                  src_operands:
                    - operand: "$0"
                      color: "RED"
                    - operand: "#1"
                      color: "RED"
                  dst_operands:
                    - operand: "NORTH"
                      color: "RED"
                    - operand: "$4"
                      color: "RED"
                - opcode: "DATA_MOV"
                  id: 1730002
                  time_step: 13
                  invalid_iterations: 0
                  src_operands:
                    - operand: "WEST"
                      color: "RED"
                  dst_operands:
                    - operand: "EAST"
                      color: "RED"
            - index_per_ii: 14
              operations:
                - opcode: "GRANT_PREDICATE"
                  id: 190
                  time_step: 14
                  invalid_iterations: 0
                  src_operands:
                    - operand: "$2"
                      color: "RED"
                    - operand: "$3"
                      color: "RED"
                  dst_operands:
                    - operand: "$1"
                      color: "RED"
                - opcode: "DATA_MOV"
                  id: 1790000
                  time_step: 14
                  invalid_iterations: 0
                  src_operands:
                    - operand: "$0"
                      color: "RED"
                  dst_operands:
                    - operand: "EAST"
                      color: "RED"
                - opcode: "DATA_MOV"
                  id: 167
                  time_step: 14
                  invalid_iterations: 0
                  src_operands:
                    - operand: "EAST"
                      color: "RED"
                  dst_operands:
                    - operand: "$0"
                      color: "RED"

in the IR above, the DATA_MOV(1790000) needs to consume the result of NOT(159) through $0. However, the $0 is overwritten for many times before the NOT can access it, including MOV(105) and GPRED(158), which is totally unrelated to this flow.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions