Skip to content

MLIR: CF block args type ptr function params as i32 (W_CheckNumForName) #232

Closed

Description

@godofecht

Problem

After bitwise lowering works, doom-flow BACKEND=mlir fails mlir-opt with:

error: use of value '%arg0' expects different type than prior uses: 'i32' vs '!llvm.ptr'
  cf.br ^bb56(%arg0 : i32)

in func.func @W_CheckNumForName(%arg0: !llvm.ptr) -> i32 while ^bb56 is declared (%626: i32).

Repro

# flow tip with bitwise fix + doom-flow
cd doom-flow
PYTHONPATH=$HOME/flow/src python3 -m flow.transpiler doom.flow --mlir --llvm --lenient -o /tmp/doom.ll

Also seen in S_UpdateSounds and configshim_atof (7 sites total in a full doom.mlir).

Expected

CF successor operands use SSA values whose types match the block arguments — do not re-label a !llvm.ptr %arg0 as i32.

Context

doom-flow dual-build (BACKEND=mlir ./scripts/build_wasm.sh) — follow-up after #221 / #229.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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