Fix LLVM fdiv and fptosi to Neura conversion and reorganize benchmarks#162
Merged
n0thingNoob merged 27 commits intomainfrom Oct 19, 2025
Merged
Fix LLVM fdiv and fptosi to Neura conversion and reorganize benchmarks#162n0thingNoob merged 27 commits intomainfrom
n0thingNoob merged 27 commits intomainfrom
Conversation
- histogram.cpp: Main test program with test data - histogram_kernel.cpp: Kernel implementation - histogram_kernel.ll: LLVM IR generated from kernel - histogram_kernel.mlir: MLIR representation from LLVM IR - histogram_kernel_neura.mlir: Neura dialect with compilation issues
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes LLVM to Neura dialect conversion issues and reorganizes test infrastructure. The changes enable proper handling of floating-point division and type conversion operations while consolidating benchmark resources.
- Adds conversion patterns for
llvm.fdivtoneura.fdivandllvm.fptositoneura.cast - Fixes type definitions in NeuraOps.td (removes Optional from FDivOp rhs, adds traits)
- Adds histogram kernel test files demonstrating the conversion pipeline
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/Conversion/LlvmToNeura/LlvmToNeuraPass.cpp | Implements conversion patterns for fdiv and fptosi operations |
| include/NeuraDialect/NeuraOps.td | Fixes FDivOp definition by making rhs non-optional and adding SameOperandsAndResultElementType trait |
| test/e2e/histogram/histogram_kernel.mlir | Adds end-to-end test with FileCheck directives for histogram kernel compilation |
| test/e2e/histogram/histogram_kernel.ll | Provides LLVM IR source for histogram kernel test |
| test/e2e/histogram/histogram_kernel.cpp | Source C++ implementation of histogram kernel |
| test/testbench/histogram/histogram_kernel_neura.mlir | Contains partially converted Neura dialect representation with mixed llvm/neura ops |
| test/testbench/histogram/histogram_kernel.mlir | LLVM dialect representation for testbench |
| test/testbench/histogram/histogram_kernel.ll | LLVM IR source for testbench |
| test/testbench/histogram/histogram_kernel.cpp | C++ source for testbench kernel |
| test/testbench/histogram/histogram.cpp | Full testbench program with kernel invocation |
| .gitmodules | Updates CGRA-Bench submodule path configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Removed duplicate submodule entry for CGRA-Bench.
- Add FIR kernel C++ source, LLVM IR, and MLIR test files - Add LlvmFMulAddToNeuraFMulFAdd conversion rule for llvm.fmuladd - Add histogram testbench files - Fix .gitmodules submodule configuration
Resolved conflicts: - Removed histogram_kernel_intermediate.mlir (deleted by remote) - Kept test/e2e/histogram/histogram.cpp (moved from testbench) - Updated .gitmodules and histogram_kernel.mlir with remote changes
- Remove tmp-generated-instructions.* files - Remove *_final.mlir, *_mapped.mlir, *_processed.mlir files - Remove *_log.txt and *.backup files - Update .gitignore to prevent future commits of temporary files - Keep only essential source files and test files
- Change Neura_OrOp arguments from AnySignlessInteger to AnyType - This allows neura.or to work with !neura.data<i64, i1> types - Fixes GitHub CI test failure for histogram kernel
tancheng
reviewed
Oct 19, 2025
- Remove all FFT test files from test/testbench/FFT/ - Remove fusion kernel files from test/neura/fusion/ - Clean up unnecessary test files
tancheng
reviewed
Oct 19, 2025
- Add llvm-project/build/bin to PATH after LLVM build - Add build/bin to PATH after dataflow build - This ensures llvm-extract and mlir-neura-opt are available in CI tests - Fixes 'llvm-extract: command not found' error in GitHub Actions
tancheng
reviewed
Oct 19, 2025
tancheng
reviewed
Oct 19, 2025
tancheng
approved these changes
Oct 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I also added the kernel.cpp and kernel.ll to the e2e/histogram because I am not sure if the kernel I am using is correct, which also requires a review.