This is an archive of the discontinued LLVM Phabricator instance.

[Docs][CodeGenerator] Don't specify the number of operands in BuildMI
ClosedPublic

Authored by thegameg on Jun 28 2016, 3:42 PM.

Details

Summary

Since rL31947, MI constructors take a TargetInstrDescriptor, instead of an instruction and a number of operands. The documentation seems to be outdated.

Diff Detail

Event Timeline

thegameg updated this revision to Diff 62144.Jun 28 2016, 3:42 PM
thegameg retitled this revision from to [Docs][CodeGenerator] Don't specify the number of operands in BuildMI.
thegameg updated this object.
thegameg added reviewers: dexonsmith, kparzysz, rnk.
thegameg added a subscriber: llvm-commits.
kparzysz added inline comments.Jun 29 2016, 5:45 AM
docs/CodeGenerator.rst
391

Typo.

392

The "get" function is in TargetInstrInfo. Could you make it explicit in the examples? E.g.

MachineInstr *MI = BuildMI(MBB, DL, TII.get(X86::MOV32ri), DestReg).addImm(42);
thegameg updated this revision to Diff 62219.Jun 29 2016, 6:45 AM

DebufLoc -> DebugLog. My bad.

Use TTI.get(Opcode) instead of get(Opcode).

thegameg marked 2 inline comments as done.Jun 29 2016, 6:46 AM
kparzysz added inline comments.Jun 29 2016, 7:03 AM
docs/CodeGenerator.rst
390

In the LLVM sources, TTI usually denotes TargetTransformInfo. A reference to TargetInstrInfo is usually held in TII.

thegameg updated this revision to Diff 62221.Jun 29 2016, 7:09 AM

TTI -> TII.

Thank you for your patience :/.

thegameg marked an inline comment as done.Jun 29 2016, 7:10 AM
kparzysz accepted this revision.Jun 29 2016, 7:11 AM
kparzysz edited edge metadata.
This revision is now accepted and ready to land.Jun 29 2016, 7:11 AM

Thanks kparzysz. I don't have commit access, can you commit this for me, please? Thanks.

This revision was automatically updated to reflect the committed changes.