This is an archive of the discontinued LLVM Phabricator instance.

llvm-reduce: Fix opcode reduction leaving behind dead instructions
ClosedPublic

Authored by arsenm on Oct 23 2022, 11:02 AM.

Details

Reviewers
aeubanks
regehr
Summary

ce3c3cb2912425bb4367bfbe9a4c68a6d6f0a04a broke this by
speculatively making transforms before checking shouldKeep.
Originally I tried to roll back changes to the IR, but it's probably
best to not touch it before querying.

Diff Detail

Event Timeline

arsenm created this revision.Oct 23 2022, 11:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2022, 11:02 AM
arsenm requested review of this revision.Oct 23 2022, 11:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 23 2022, 11:02 AM
Herald added a subscriber: wdng. · View Herald Transcript
aeubanks accepted this revision.Oct 23 2022, 12:13 PM

whoops, sorry I missed this in my patch

the alternative is to not using IRBuilder and not insert the instruction into the module unless the oracle says so, this patch is a little messier code wise but less work at runtime

This revision is now accepted and ready to land.Oct 23 2022, 12:13 PM