This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Emit instruction name in INSTRINFO_OPERAND_TYPE
ClosedPublic

Authored by Amir on Jun 15 2022, 8:41 PM.

Details

Summary

Make Offsets and OpcodeOperandTypes tables human-readable by printing the
instruction name before the operand list.

In effect, this makes debugging generated getOperandType possible.

Diff Detail

Event Timeline

Amir created this revision.Jun 15 2022, 8:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2022, 8:41 PM
Amir requested review of this revision.Jun 15 2022, 8:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2022, 8:41 PM
Amir updated this revision to Diff 438212.Jun 19 2022, 1:01 PM

clang-format

craig.topper added inline comments.Jun 19 2022, 2:59 PM
llvm/utils/TableGen/InstrInfoEmitter.cpp
392

This is only storing the name of the last instruction that uses the offset. An instruction with no operands won't increment CurrentOffset.

417

I think I here is the instruction number. Can't we just look it up via NumberedInstructions[I]?

432

I think CurOffset here is the instrution number. Can we look up NumberedInstructions[CurOffset]?

435

Should we print the names of instructions with no operands here?

Amir updated this revision to Diff 438222.Jun 19 2022, 3:53 PM

Address Craig's comments

Amir marked 4 inline comments as done.Jun 19 2022, 3:55 PM
Amir added inline comments.
llvm/utils/TableGen/InstrInfoEmitter.cpp
392

You're right, thank you so much! I was initially keeping something else in this map, but in a later iterations this reduced only to the opcode which can be referenced from NumberedInstructions

Amir marked an inline comment as done.Jun 19 2022, 3:55 PM
This revision is now accepted and ready to land.Jun 19 2022, 7:51 PM
This revision was landed with ongoing or failed builds.Jun 20 2022, 12:24 PM
This revision was automatically updated to reflect the committed changes.

Hi, we're seeing a failure in Fuchsia's Clang CI for windows.

The failing test is LLVM :: TableGen/get-operand-type.td

You can find the failing bot here: https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-windows-x64/b8810810347109726705/overview

If this will be hard to address, would you mind reverting until a fix is ready?

Amir added a comment.Jun 21 2022, 9:54 AM

Hi, we're seeing a failure in Fuchsia's Clang CI for windows.

The failing test is LLVM :: TableGen/get-operand-type.td

You can find the failing bot here: https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-windows-x64/b8810810347109726705/overview

If this will be hard to address, would you mind reverting until a fix is ready?

Hi @paulkirth,
I’ve addressed this test failure in the 2nd commit (the first one is reverted): https://reviews.llvm.org/rG31e2bba155986b1416c70655c9f5f9e77c2abd46
I couldn’t find a commit hash in the build page, can you please confirm which one is it?

Sorry, our CI batches builds so sometimes it's non-obvious. You can find them all under the blame heading. I think they're also somewhere else on that page, but that is always where I go.

It should be 4cd416193cc126355a22b2c9e5c1df3a49b59e50.

Sorry, you can ignore my spam here. There's a newer failure that is still ongoing and I've mis-attributed it to this change. I think you're fine as is.

Again, appologies.

Amir added a comment.Jun 21 2022, 10:26 AM

Sorry, you can ignore my spam here. There's a newer failure that is still ongoing and I've mis-attributed it to this change. I think you're fine as is.

Again, appologies.

No problem, thank you for vigilance!