Skip to content

[Fix] eliminate llvm unsupported type (Float8/4) before llvm conversion#415

Merged
coderfeli merged 1 commit intomainfrom
pr/fix-llvm-type
Apr 20, 2026
Merged

[Fix] eliminate llvm unsupported type (Float8/4) before llvm conversion#415
coderfeli merged 1 commit intomainfrom
pr/fix-llvm-type

Conversation

@sjfeng1999
Copy link
Copy Markdown
Collaborator

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

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 updates Fly’s register-to-SSA promotion and Fly→ROCDL lowering to proactively eliminate LLVM-unsupported small-float element types (e.g., fp8/fp4) by projecting them to same-bitwidth integer types before LLVM dialect conversion.

Changes:

  • Introduces projectToLLVMCompatibleElemTy and extends RegMem2SSAType(..., llvmCompatibleType=true) to project small floats to same-width integers.
  • Updates regmem promotion + atom-call SSA conversion paths to use LLVM-compatible SSA element types (with bitcasts as needed).
  • Extends Fly→ROCDL type conversion and adds/updates MLIR tests covering fp8 SSA MMA lowering.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/mlir/Transforms/promote_regmem_to_ssa.mlir Updates FileCheck expectations to reflect fp8→i8 vector bitcasts during regmem-to-SSA promotion.
tests/mlir/Conversion/mma_atom.mlir Adds a conversion test ensuring fp8 SSA MMA uses vector<8xi8> and lowers via llvm.bitcast to i64 for MFMA.
lib/Dialect/FlyROCDL/GFX1250/MmaAtom.cpp Bitcasts SSA inputs to expected ROCDL operand/accumulator types before WMMA emission.
lib/Dialect/FlyROCDL/CDNA4/CopyAtom.cpp Requests LLVM-compatible SSA types for register memrefs in copy atom lowering.
lib/Dialect/FlyROCDL/CDNA3/MmaAtom.cpp Bitcasts SSA inputs to expected MFMA operand/accumulator types; removes unused includes.
lib/Dialect/FlyROCDL/CDNA3/CopyAtom.cpp Requests LLVM-compatible SSA types for register memrefs; fixes switch completeness in getFieldIndex.
lib/Dialect/Fly/Utils/PointerUtils.cpp Implements projectToLLVMCompatibleElemTy and adds llvmCompatibleType control to RegMem2SSAType.
lib/Dialect/Fly/Transforms/PromoteRegMemToVectorSSA.cpp Promotes regmem SSA vectors using LLVM-compatible element types and inserts element-type bitcasts.
lib/Dialect/Fly/Transforms/ConvertAtomCallToSSAForm.cpp Loads/stores promoted regmem using LLVM-compatible SSA types for atom-call SSA conversion.
lib/Dialect/Fly/IR/FlyUniversalOps.cpp Uses LLVM-compatible SSA types for universal atomic copy lowering.
lib/Conversion/FlyToROCDL/FlyToROCDL.cpp Projects small-float element types for alloca/GEP and adds type-converter rules for small-float→int (including vectors).
include/flydsl/Dialect/Fly/Utils/PointerUtils.h Declares new projection helper and extends RegMem2SSAType API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/Dialect/Fly/Transforms/PromoteRegMemToVectorSSA.cpp
Comment thread lib/Dialect/Fly/Transforms/PromoteRegMemToVectorSSA.cpp
@sjfeng1999 sjfeng1999 force-pushed the pr/fix-llvm-type branch 2 times, most recently from 98eb704 to f0f1a81 Compare April 20, 2026 09:11
@coderfeli coderfeli merged commit bdcfc1e into main Apr 20, 2026
10 of 11 checks passed
@coderfeli coderfeli deleted the pr/fix-llvm-type branch April 20, 2026 13:51
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