I propose two changes to instructions.
- `AllocTensor` uses shape stored in the register instead of hardcode shape in 
the instruction. This can help support dynamic shape in VM in the future. We 
can store constant shapes in the constant lists, and use `LoadConst` to load 
them.
- Change `Phi` to `Select` (defined below) that takes a condition register to 
select two values. This allows us to map SSA register number to fewer slots to 
reduce memory footage.

### AllocTensor
```
AllocTenosr $2, $1, dtype  ; %2 = AllocTensor(%1, dtype)
```
Allocate a tensor object with shape stored in register $1 and save to register 
$2.

### Phi
```
Select $4, $1, $2, $3  ; %4 = (%1) ? %2 : %3
```
Select VMObject either in $2 or $3 based on condition register $1, and store in 
$4.

cc @tqchen @jroesch @wweic @zhiics @yongwww

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/issues/2915#issuecomment-481840770

Reply via email to