Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMDGPU][GISel] Fold 'min(min(x,y),z)' and 'max(max(x,y),z)' into min3 and max3 #124263

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ruhung
Copy link
Contributor

@Ruhung Ruhung commented Jan 24, 2025

Draft PR, test cases in progress.

Fold 'min(min(x,y),z)' and 'max(max(x,y),z)' into min3 and max3

Fixes: #123079

Comment on lines 188 to 193
def AMDGPURegBankCombiner
: GICombiner<"AMDGPURegBankCombinerImpl",
[unmerge_merge, unmerge_cst, unmerge_undef, zext_trunc_fold,
int_minmax_to_med3, ptr_add_immed_chain, fp_minmax_to_clamp,
fp_minmax_to_med3, fmed3_intrinsic_to_clamp,
minmax_to_minmax3, redundant_and]> {}
Copy link
Contributor

Choose a reason for hiding this comment

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

This lint is irrelevant, so probably we should exclude it from the PR.

def minmax_to_minmax3
: GICombineRule<
(defs root:$min_or_max, minmax3_matchdata:$matchinfo),
(match(wip_match_opcode G_SMAX, G_SMIN, G_UMAX, G_UMIN, G_FMAXNUM,
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

[AMDGPU][GISel] Missing FMAX3 use
2 participants