Issue 165657
Summary arith.select errors when using vector as condition
Labels new issue
Assignees
Reporter Subway2023
    **Describe the bug**
When using `arith.select` with a vector as the condition operand, MLIR fails to parse the IR and reports an SSA operand error. The operation works fine with scalar `i1` conditions but not with `vector<i1>`.

**To Reproduce**

```mlir
module {
  func.func @main() {
    %vcond = arith.constant dense<[1, 0]> : vector<2xi1>
    %vx = arith.constant dense<[10, 30]> : vector<2xi32>
 %vy = arith.constant dense<[20, 40]> : vector<2xi32>
    %vz = arith.select %vcond, %vx, %vy : vector<2xi32>
    vector.print %vz : vector<2xi32>
 return
  }
}
```

**Error message**

```
mlir-opt arith_select.mlir
arith_select.mlir:6:24: error: use of value '%vcond' expects different type than prior uses: 'i1' vs 'vector<2xi1>'
    %vz = arith.select %vcond, %vx, %vy : vector<2xi32>
 ^
/mnt/sdd1/sbw/mlir/data/seed/chatgptMlir/vector/arith_select.mlir:3:5: note: prior use here
    %vcond = arith.constant dense<[1, 0]> : vector<2xi1>
    ^
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to