Skip to content

[NFC] Remove unused operation#2306

Merged
Mr-Anyone merged 1 commit intodevelopfrom
remove-dead-code
Mar 24, 2026
Merged

[NFC] Remove unused operation#2306
Mr-Anyone merged 1 commit intodevelopfrom
remove-dead-code

Conversation

@Mr-Anyone
Copy link
Copy Markdown
Member

Motivation

Remove unused operations.

Technical Details

I suspect that this operation is never used for the following reasons:

There is no lowering from migraphx.flatten to the Tosa pipeline.

root@31dddf580291 ~/rocMLIR/build-release ((HEAD detached at origin/develop))$ ./bin/rocmlir-opt main.mlir  --migraphx-to-tosa
main.mlir:2:3: error: failed to legalize operation 'migraphx.flatten' that was explicitly marked illegal
  migraphx.flatten %arg0 {axis = 0 : i64}: <1x1xf32, 1x1> -> <1xf32, 1>
  ^
main.mlir:2:3: note: see current operation: %0 = "migraphx.flatten"(%arg0) <{axis = 0 : i64}> : (!migraphx.shaped<1x1xf32, 1x1>) -> !migraphx.shaped<1xf32, 1>
root@31dddf580291 ~/rocMLIR/build-release ((HEAD detached at origin/develop))$ 

There is no reference of FlattenOp in MIGraphXToTosa.cpp.

I ran git log --oneline | grep flatten and nothing significant seems to show up.

root@31dddf580291 ~/rocMLIR/build-release ((HEAD detached at origin/develop))$ git log --oneline | grep flatten
c74e8539ff37 [Analysis] flatten enums for recurrence types
d00f59de80f1 [test][NewPM] Pin -flattencfg test to legacy PM
d53b4bee0ccd [LoopFlatten] Add a loop-flattening pass
9e783716a224 [llvm-libtool-darwin] Allow flattening archives
55d5e6cbe250 [flang] Remove flatten and merge upstreaming script.
42cc44fbc8dc [flang] Add script to flatten git history for llvm monorepo submission (flang-compiler/f18#854)
5c5880db2f17 [flang] Merge pull request flang-compiler/f18#868 from schweitzpgi/remove-flatten
d98cb81cd11c Handle successor's PHI node correctly when flattening CFG merges two if-regions
957380714da3 [clangd] Unfold SourceLocation flattening from findNameLoc in preparation for adding more overloads. NFC
1693b80bd567 [SimplifyCFG][NFC] Test that we fail to flatten CFG in JPEG "sign" value extend pattern
fca23d74c963 [SimplifyCFG][NFC] Test that we fail to flatten CFG after forming @llvm.umul.with.overflow
ec66bc57a879 Add helper to get flattened tuple types

It was introduced in this commit - the inception of MIGraphX dialect and it doesn't have any testcase.

Test Plan

N/A

Test Result

N/A

Submission Checklist

@Mr-Anyone Mr-Anyone requested a review from causten as a code owner March 19, 2026 14:57
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2306      +/-   ##
===========================================
- Coverage    79.50%   78.89%   -0.62%     
===========================================
  Files          100      123      +23     
  Lines        31016    40444    +9428     
  Branches      4819     6638    +1819     
===========================================
+ Hits         24659    31905    +7246     
- Misses        4245     5634    +1389     
- Partials      2112     2905     +793     
Flag Coverage Δ
mfma ?
navi4x 78.89% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 101 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Mr-Anyone Mr-Anyone force-pushed the remove-dead-code branch 4 times, most recently from c67cd22 to 9212ebf Compare March 24, 2026 13:00
@Mr-Anyone Mr-Anyone merged commit b235766 into develop Mar 24, 2026
7 of 14 checks passed
@Mr-Anyone Mr-Anyone deleted the remove-dead-code branch March 24, 2026 21:18
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.

2 participants