Skip to content

Fix LLVM fdiv and fptosi to Neura conversion and reorganize benchmarks#162

Merged
n0thingNoob merged 27 commits intomainfrom
testbench
Oct 19, 2025
Merged

Fix LLVM fdiv and fptosi to Neura conversion and reorganize benchmarks#162
n0thingNoob merged 27 commits intomainfrom
testbench

Conversation

@n0thingNoob
Copy link
Copy Markdown
Collaborator

  • Fix Neura_FDivOp and Neura_OrOp type definitions in NeuraOps.td
  • Add LlvmFDivToNeuraFDiv and LlvmFPToSIToNeuraCast conversion patterns
  • Move CGRA-Bench submodule to test/benchmark/CGRA-Bench
  • Add histogram kernel test files to test/e2e/histogram/
    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.

- 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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.fdiv to neura.fdiv and llvm.fptosi to neura.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.

n0thingNoob and others added 12 commits October 18, 2025 17:01
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
- 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
@n0thingNoob n0thingNoob marked this pull request as ready for review October 19, 2025 16:19
@n0thingNoob n0thingNoob merged commit f0aca7c into main Oct 19, 2025
1 check passed
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.

3 participants