Skip to content

Incorrect pattern DynamicIotaOpToBroadcast  #2628

@christopherbate

Description

@christopherbate

What happened?

// RUN: stablehlo-opt %s -stablehlo-aggressive-simplification

func.func @dynamic_iota_broadcast_second(%arg0 : tensor<2xi32>) -> tensor<5x?xi32> {
  %0 = "stablehlo.dynamic_iota"(%arg0) <{iota_dimension = 1 : i64}> : (tensor<2xi32>) -> tensor<5x?xi32>
  func.return %0 : tensor<5x?xi32>
}

Pattern DynamicIotaOpToBroadcast assumes arith.index_cast can be used even if operand and result types are both not index, but this is not true (perhaps it was at the time the MHLO code was written).

Anyways, it seems like arith.index_cast shouldn't be required anymore.

Steps to reproduce your issue

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Version information

No response

Metadata

Metadata

Assignees

No one assigned

    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