llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[mlir][arith] `arith.addui_extended` on `index` types rejected on lowering: what's the intended semantics?

Open pingshiyu opened this issue 2 years ago • 0 comments

Reproduction: https://godbolt.org/z/6jMa76WEb

module {
  func.func @main() {
    %ca = arith.constant 5 : index
    %c1 = call @get_idx() : () -> (index)
    %sum, %overflow = arith.addui_extended %ca, %c1 : index, i1 
    vector.print %sum : index
    vector.print %overflow : i1
    return
  }
  func.func @get_idx() -> (index) {
    %c1 = arith.constant 1 : index
    return %c1 : index
  }
}

fails to lower with mlir-opt --test-lower-to-llvm. From the spec it seems like it should work on index types too, as the supported lhs, rhs types are "signless-integer-like", which includes index types.

If this rejection is intended, then we should update the spec

pingshiyu avatar Mar 12 '24 21:03 pingshiyu