Skip to content

Commit

Permalink
[AIE2P] Combine G_SHUFFLE_VECTOR into ExtractSubvector+Broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
katerynamuts committed Jan 31, 2025
1 parent ab6aab4 commit 73119f3
Show file tree
Hide file tree
Showing 4 changed files with 379 additions and 173 deletions.
15 changes: 4 additions & 11 deletions llvm/lib/Target/AIE/AIECombine.td
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,15 @@ def combine_vector_broadcast : GICombineRule<
(apply [{ applySplatVector(*${root}, MRI, B, ${matchinfo}); }])>;

def combine_vector_shuffle_broadcast : GICombineRule<
(defs root:$root, combine_splat_vector_matchdata:$matchinfo),
(match (wip_match_opcode G_SHUFFLE_VECTOR): $root,
[{ return matchShuffleToBroadcast(*${root}, MRI, ${matchinfo}); }]),
(apply [{ applySplatVector(*${root}, MRI, B, ${matchinfo}); }])>;

def combine_vector_shuffle_vsel : GICombineRule<
(defs root:$root, build_fn_matchinfo:$matchinfo),
(match (wip_match_opcode G_SHUFFLE_VECTOR): $root,
[{ return matchShuffleToVSel(*${root}, MRI, (const AIEBaseInstrInfo &)B.getTII(), ${matchinfo}); }]),
[{ return matchShuffleToBroadcast(*${root}, MRI, (const AIEBaseInstrInfo &)B.getTII(), ${matchinfo}); }]),
(apply [{ Helper.applyBuildFn(*${root}, ${matchinfo}); }])>;

def combine_shuffle_to_vextbcst : GICombineRule<
def combine_vector_shuffle_vsel : GICombineRule<
(defs root:$root, build_fn_matchinfo:$matchinfo),
(match (wip_match_opcode G_SHUFFLE_VECTOR): $root,
[{ return matchShuffleToExtractBroadcast(*${root}, MRI, (const AIEBaseInstrInfo &)B.getTII(), ${matchinfo}); }]),
[{ return matchShuffleToVSel(*${root}, MRI, (const AIEBaseInstrInfo &)B.getTII(), ${matchinfo}); }]),
(apply [{ Helper.applyBuildFn(*${root}, ${matchinfo}); }])>;

def combine_vector_shuffle_extract_subvec : GICombineRule<
Expand All @@ -112,8 +106,7 @@ def AIE2PPreLegalizerCombiner
combine_splat_vector, combine_vector_broadcast,
combine_concat_to_pad_vector,
combine_vector_shuffle_broadcast,
combine_vector_shuffle_vsel,
combine_shuffle_to_vextbcst]> {
combine_vector_shuffle_vsel]> {
let CombineAllMethodName = "tryCombineAllImpl";
}

Expand Down
Loading

0 comments on commit 73119f3

Please sign in to comment.