This is an archive of the discontinued LLVM Phabricator instance.

[llvm-reduce] Specify ShouldPreserveUseListOrder for internal .ll dumps
ClosedPublic

Authored by markus on Jan 31 2022, 2:03 AM.

Details

Summary

I recently ran into a case where I was trying to reduce a .bc file and the interestingness test I had written reported that the input was interesting when run in isolation but when running llvm-reduce it failed the initial sanity check before reduction starts. Turns out that internally llvm-reduce only deals with .ll files and does not set the ShouldPreserveUseListOrder option when producing these. For this rare case setting the option made the difference between being able to reduce or not.

I suggest that we either always set that option or alternatively add a command line option to have it set.

Diff Detail

Event Timeline

markus requested review of this revision.Jan 31 2022, 2:03 AM
markus created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2022, 2:03 AM
fhahn added a subscriber: fhahn.Jan 31 2022, 2:10 AM

This makes sense to me, but I think this is another motivation to use bitcode as default for temporary files (flip the default of TmpFilesAsBitcode to true)

This makes sense to me, but I think this is another motivation to use bitcode as default for temporary files (flip the default of TmpFilesAsBitcode to true)

Ah, I was not aware we had an option for bitcode (I see now it has been added somewhat recently). I agree it would make more sense to have that as default or perhaps even better that the intermediate format follows the format of the input file.
It is a bit unfortunate though that this option does not show when one does a llvm-reduce --help (I believe the same is true for a few of the other options as well).

aeubanks accepted this revision.Jan 31 2022, 9:19 AM

does bitcode preserve use list orders?

but anyway this patch lgtm

This revision is now accepted and ready to land.Jan 31 2022, 9:19 AM
This revision was landed with ongoing or failed builds.Feb 1 2022, 12:25 AM
This revision was automatically updated to reflect the committed changes.