Skip to content

Conversation

@Fangtangtang
Copy link

When compiling with aiecc.py, I encountered errors such as:

error: expected ')' at end of argument list
declare void @llvm.memcpy.p0.p0.i64(ptr noalias writeonly captures(none), ptr noalias readonly captures(none), i64, i1 immarg) #1
                                                          ^

This was caused by the presence of captures(none) in the IR.
To fix this, I updated compiler/aiecc/main.py so that downgrade_ir_for_peano now replaces captures(none):

def downgrade_ir_for_peano(llvmir):
    llvmir = llvmir.replace("getelementptr inbounds nuw", "getelementptr inbounds")
    llvmir = llvmir.replace("captures(none)", "nocapture")
    return llvmir

This resolves the compilation error and allows the IR to be correctly lowered.

Note: I noticed a similar issue was mentioned earlier in PR #2038

@andrej
Copy link
Collaborator

andrej commented Sep 22, 2025

Thanks for your contribution. @fifield's earlier PR you mention seems to address chess specifically, and I haven't run across this issue with peano.

Before merging this in, I want to make sure this isn't already addressed by a newer peano version. Can you share your peano version and exact command you ran that caused you to run into this issue? After setting your environment, running $PEANO_INSTALL_DIR/bin/clang++ --version should give you the version.

@Fangtangtang
Copy link
Author

Hi, I'm using clang version 19.0.0 (https://github.com/Xilinx/llvm-aie b2a279c1939604e2ee82a651683dd995decc25ee).

I ran into this error when running the following command:
aiecc.py --alloc-scheme=basic-sequential --aie-generate-xclbin --no-compile-host --xclbin-name=build/final.xclbin --no-xchesscc --no-xbridge --peano ${PEANO_INSTALL_DIR} --aie-generate-npu-insts --npu-insts-name=insts.txt top.mlir

I have attached a zipped copy of the working directory where I ran this command.
tmp.zip

@fifield
Copy link
Collaborator

fifield commented Sep 23, 2025

I verified the problem exists for the version of llvm-aie suggested by quick_setup.sh. However, with the latest nightly wheel of llvm-aie there is no error. The version I tried is llvm_aie-20.0.0.2025092301+6bef69

@jgmelber
Copy link
Collaborator

Is this fix worth including for users who would like to use a particular older version of LLVM-AIE? @fifield

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants