This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Add a `X, Y = G_UNMERGE(G_ZEXT Z)` -> X = G_ZEXT Z; Y = 0 combine
ClosedPublic

Authored by qcolombet on Sep 9 2020, 6:10 PM.

Details

Summary

Add a combiner helper to transform unmerge of zext into one zext and
a constant 0

Diff Detail

Event Timeline

qcolombet created this revision.Sep 9 2020, 6:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 9 2020, 6:10 PM
qcolombet requested review of this revision.Sep 9 2020, 6:10 PM
qcolombet updated this revision to Diff 290856.Sep 9 2020, 6:15 PM
  • Fix typo in comment (G_EXT -> G_ZEXT)
arsenm accepted this revision.Sep 10 2020, 4:55 PM

LGTM with nit. Could possibly use a legality check but I could't come up with an example where it would matter

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

Don't need = 0

This revision is now accepted and ready to land.Sep 10 2020, 4:55 PM
qcolombet updated this revision to Diff 291695.Sep 14 2020, 2:46 PM
  • Use Register default constructor instead of forcing = 0
qcolombet marked an inline comment as done.Sep 14 2020, 2:46 PM
This revision was landed with ongoing or failed builds.Sep 14 2020, 6:30 PM
This revision was automatically updated to reflect the committed changes.