llvm / llvm/Polygeist

[bug] `AffineApplyNormalizer` assert Error

Open
#421 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
624
Forks
170
PR merge metrics
No merged PRs in 30d

Description

When running my code using cgeist with the --raise-scf-to-affine option, I encountered the following error:
> cgeist: ../lib/polygeist/Passes/AffineCFG.cpp:534: AffineApplyNormalizer::AffineApplyNormalizer(mlir::AffineMap, llvm::ArrayRef, mlir::PatternRewriter&, mlir::DominanceInfo&): Assertion `isValidSymbolInt(t, false)' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

Use the following minimal code example (saved as test.c) that reproduces the error,run the code using `cgeist test.c --raise-scf-to-affine --function=* -S --memref-fullrank -o test.mlir`
```c
void nested_loop_using_variable_as_step(int vali[20][30]) {
int stepx = vali[0][0];
for (int x = 0; x < 20; x++) {
for (int y = 1; y < 30; y += stepx) {
vali[x][y] = 1;
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/polygeist/Passes/AffineCFG.cpp at AffineApplyNormalizer::AffineApplyNormalizer, then reproduce the assertion using the supplied test.c and cgeist command with --raise-scf-to-affine. Trace the failing symbol validation for the variable loop step; done means this reproducer no longer triggers the assertion and produces the expected output.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.