Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] arith.fptoui issue with negative loop bound #153

Open
zzzDavid opened this issue Apr 29, 2024 · 0 comments
Open

[BUG] arith.fptoui issue with negative loop bound #153

zzzDavid opened this issue Apr 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@zzzDavid
Copy link
Contributor

Describe the bug
Negative loop bound fails at IR building stage.

To Reproduce

import allo
from allo.ir.types import int32

N = 256

def compute(
    x: int32[N],
    y: int32[N]
):
    for i in range(N-1, -1, -1):
        y[i+1] = x[i+1]


s = allo.customize(compute)
print(s.module)

Buggy output

Traceback (most recent call last):
  File "/work/shared/users/phd/nz264/machsuite-allo/viterbi/viterbi.py", line 63, in <module>
    mod = s.build()
          ^^^^^^^^^
  File "/work/shared/users/phd/nz264/allo/allo/customize.py", line 682, in build
    return LLVMModule(
           ^^^^^^^^^^^
  File "/work/shared/users/phd/nz264/allo/allo/backend/llvm.py", line 59, in __init__
    self.module = Module.parse(str(mod), ctx)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
hcl_mlir._mlir_libs._site_initialize.<locals>.MLIRError: Unable to parse module assembly:
error: "-":154:11: 'arith.fptoui' op result #0 must be signless-fixed-width-integer-like, but got 'index'
 note: "-":154:11: see current operation: %30 = "arith.fptoui"(%25) : (f32) -> index
@zzzDavid zzzDavid added the bug Something isn't working label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant