This is an archive of the discontinued LLVM Phabricator instance.

[SlotIndexes] Add print-slotindexes to disable printing slotindexes
ClosedPublic

Authored by jsji on Aug 20 2019, 3:09 PM.

Details

Summary

When we print the IR with --print-after/before-*,
SlotIndexes will be printed whenever available (We haven't freed it).

This introduces some noises when we try to compare the IR
among different optimizations.

eg:
-print-before=machine-cp will print SlotIndexes for 1st machine-cp
pass, but NOT for 2nd machine-cp;
-print-after=machine-cp will NOT print SlotIndexes for both
machine-cp passes.
So SlotIndexes in 1st pass introduce noises when differing these IRs.

This patch introduces an option to hide indexes.

Diff Detail

Repository
rL LLVM

Event Timeline

jsji created this revision.Aug 20 2019, 3:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 20 2019, 3:09 PM

Can we also get a test for this?

llvm/lib/CodeGen/MachineBasicBlock.cpp
46 ↗(On Diff #216265)

I'd rather have this init to true, and allow users to disable it when they want to get rid of it.

jsji updated this revision to Diff 216323.Aug 20 2019, 7:51 PM

Keep the default behavior, add option to disable.
Also add a testcase.

jsji retitled this revision from [SlotIndexes] Only print slotindexes when required to [SlotIndexes] Add print-slotindexes to disable printing slotindexes.Aug 20 2019, 7:52 PM
jsji edited the summary of this revision. (Show Details)
thegameg accepted this revision.Aug 21 2019, 3:40 PM

LGTM, thanks!

This revision is now accepted and ready to land.Aug 21 2019, 3:40 PM
This revision was automatically updated to reflect the committed changes.