Skip to content

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

Open
@pingshiyu

Description

@pingshiyu

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions