Repository navigation
Add bicg testbench, Sub and FNeg conversion - #178
Conversation
- Merged main branch changes including LlvmSelectToNeuraSel pattern - Preserved local modifications: LlvmMemsetToNeuraOps, LlvmFNegToNeuraFSub, LlvmSubToNeuraSub patterns - Resolved merge conflict in LlvmToNeuraPass.cpp
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for the bicg (BiConjugate Gradient) benchmark testbench and implements conversions for LLVM Sub and FNeg operations to corresponding Neura dialect operations. The changes also include a memset intrinsic handler, though the PR description focuses on addressing remaining Constant Op issues in the generated IR.
Key Changes
- Added comprehensive bicg kernel testbench with RUN commands for compilation, lowering, mapping, and verification
- Implemented LLVM FNeg to Neura FSub conversion (negation via subtraction from zero)
- Implemented LLVM Sub to Neura Sub conversion for integer subtraction
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| test/e2e/bicg/bicg_kernel.mlir | New end-to-end testbench for bicg kernel with compilation pipeline and FileCheck assertions |
| lib/Conversion/LlvmToNeura/LlvmToNeuraPass.cpp | Added pattern rewrites for memset intrinsic, FNeg, and Sub operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Thanks, I'll review this PR today 😄 |
|
Hi @n0thingNoob I've checked the bicg case, After folding constant, it does have some operators not folded: Take operator This situation is expected because I set a safe line that operation must have at least 1 operator not be folded. So even So here comes a question @tancheng
It is reasonable to fold all the constant: And it is natural to calculate %0 as a constant directly:
After folding all constant: We cannot calculate the value of %0 😭 and it will case error when running subsequent PASS So how shall we deal with this problem 🤔 |
Anyways, @n0thingNoob it is okay to have constant op left. I was wrong if I said there shouldn't any |
Got it. I'll add the constraint 🚀 |
I see. And is there anything I need to change for this PR? |
@YanzhouTang Can you try this bicg testbench? I have merged the latest commit you submitted, but the generated IR still contains the Constant Op inside.