This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][GlobalISel] Combine unmerge of undef
ClosedPublic

Authored by sebastian-ne on Jan 25 2022, 5:54 AM.

Details

Summary

Fold (unmerge undef) -> undef, undef, ...

Diff Detail

Event Timeline

sebastian-ne created this revision.Jan 25 2022, 5:54 AM
sebastian-ne requested review of this revision.Jan 25 2022, 5:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 25 2022, 5:54 AM
foad added inline comments.Jan 25 2022, 6:09 AM
llvm/include/llvm/Target/GlobalISel/Combine.td
543

Could use applyBuildFn if you prefer, as it avoids writing a separate "apply" function of your own.

llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
1754

Could return isa<GImplicitDef>(MRI.getVRegDef(SrcReg)) if you prefer.

llvm/test/CodeGen/AMDGPU/GlobalISel/postlegalizercombiner-select.mir
1

Can you regenerate the checks in this file and commit it please (consider it pre-approved) and then rebase this patch?

sebastian-ne marked 2 inline comments as done.

Thanks, the patch got smaller with applyBuildFn.

foad accepted this revision.Jan 25 2022, 6:29 AM

LGTM. Maybe wait a bit in case anyone else has comments.

This revision is now accepted and ready to land.Jan 25 2022, 6:29 AM
arsenm accepted this revision.Jan 25 2022, 6:38 AM

Could also do the same thing for constants. We probably emit a few unmerge of constants during legalization

foad added a comment.Jan 25 2022, 6:44 AM

Could also do the same thing for constants. We probably emit a few unmerge of constants during legalization

Should already be done by the unmerge_cst combine.

This revision was landed with ongoing or failed builds.Jan 26 2022, 3:31 AM
This revision was automatically updated to reflect the committed changes.