Skip to content

MLIR verifier does not enforce type-checking at the level of span. #10

@AiredaleDev

Description

@AiredaleDev

The frontend presently catches such programs but the following IR presently passes the verifier:

module {
  qwerty.func @dead_simple_0[]() irrev-> !qwerty<bitbundle[1]> {
    %0 = qwerty.qbprep Z<MINUS>[1] : () -> !qwerty<qbundle[1]>
    %1 = qwerty.lambda[](%arg0: !qwerty<qbundle[1]>) rev-> !qwerty<qbundle[1]> {
      // OBSERVE THAT THE TWO BASES IN THIS TRANSLATION DO NOT SPAN THE SAME SPACE
      %5 = qwerty.qbtrans %arg0 by {list:{"|0>"}} >> {list:{"|1>", "|0>"}} : (!qwerty<qbundle[1]>) -> !qwerty<qbundle[1]>
      qwerty.return %5 : !qwerty<qbundle[1]>
    }
    %2 = qwerty.call_indirect %1(%0) : (!qwerty<func(!qwerty<qbundle[1]>) rev-> !qwerty<qbundle[1]>>, !qwerty<qbundle[1]>) -> !qwerty<qbundle[1]>
    %3 = qwerty.lambda[](%arg0: !qwerty<qbundle[1]>) irrev-> !qwerty<bitbundle[1]> {
      %5 = qwerty.qbmeas %arg0 by {std: Z[1]} : !qwerty<qbundle[1]> -> !qwerty<bitbundle[1]>
      qwerty.return %5 : !qwerty<bitbundle[1]>
    }
    %4 = qwerty.call_indirect %3(%2) : (!qwerty<func(!qwerty<qbundle[1]>) irrev-> !qwerty<bitbundle[1]>>, !qwerty<qbundle[1]>) -> !qwerty<bitbundle[1]>
    qwerty.return %4 : !qwerty<bitbundle[1]>
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions