This is an archive of the discontinued LLVM Phabricator instance.

[TableGen][GlobalISel] Add MIR Pattern Builtins
ClosedPublic

Authored by Pierre-vh on Aug 28 2023, 3:25 AM.

Details

Summary

Adds a new feature to MIR patterns: builtin instructions.
They offer some additional capabilities that currently cannot be expressed without falling back to C++ code.
There are two builtins added with this patch, but more can be added later as new needs arise:

  • GIReplaceReg
  • GIEraseRoot

Depends on D158714, D158713

Diff Detail

Event Timeline

Pierre-vh created this revision.Aug 28 2023, 3:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 28 2023, 3:25 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
Pierre-vh requested review of this revision.Aug 28 2023, 3:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 28 2023, 3:25 AM
Pierre-vh added inline comments.Aug 28 2023, 3:28 AM
llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-trivial-arith.mir
77

Note: as the name of the test indicates, this isn't supposed to be replaced, so this isn't a regression - it fixes a correctness issue.

Pierre-vh updated this revision to Diff 553886.Aug 28 2023, 3:28 AM

fix small nit

arsenm accepted this revision.Aug 28 2023, 10:38 AM
This revision is now accepted and ready to land.Aug 28 2023, 10:38 AM
aemerson accepted this revision.Aug 29 2023, 7:41 AM

LGTM, nice!

Pierre-vh updated this revision to Diff 554360.Aug 29 2023, 8:21 AM

Fix test
(Note that this depends on some other patches so it can't land yet)

This revision was landed with ongoing or failed builds.Sep 4 2023, 11:20 PM
This revision was automatically updated to reflect the committed changes.