This is an archive of the discontinued LLVM Phabricator instance.

llvm-reduce: Do not try to delete frame instructions
ClosedPublic

Authored by arsenm on Apr 25 2022, 6:37 AM.

Details

Summary

The verifier enforces these appearing as balanced pairs, so just
deleting one has no real chance of producing something valid.

Diff Detail

Event Timeline

arsenm created this revision.Apr 25 2022, 6:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2022, 6:37 AM
arsenm requested review of this revision.Apr 25 2022, 6:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2022, 6:37 AM
Herald added a subscriber: wdng. · View Herald Transcript

I recall running into this as well. So this patch will make sure that they are never deleted thus improving reduction speed. But wasn't there a chance that the oracle would indicated that both instructions of the pair were to be deleted which could result in a valid reduction? I guess this is fine though and a better solution would be to deal with the frame pairs in a separate reduction pass anyway.

markus added inline comments.Apr 25 2022, 7:37 AM
llvm/test/tools/llvm-reduce/mir/remove-frame-destroy.mir
5

Is this criteria for interestingness safe given that we have two S_NOP 0 instructions in the block? Could it be that the first one gets eliminated and then it is still considered interesting but the final RESULT-NEXT fails because there is now a S_NOP 0 in the middle?

I recall running into this as well. So this patch will make sure that they are never deleted thus improving reduction speed. But wasn't there a chance that the oracle would indicated that both instructions of the pair were to be deleted which could result in a valid reduction? I guess this is fine though and a better solution would be to deal with the frame pairs in a separate reduction pass anyway.

I was thinking a frame reduction pass would be better

arsenm added inline comments.Apr 25 2022, 1:41 PM
llvm/test/tools/llvm-reduce/mir/remove-frame-destroy.mir
5

With this condition both nops should be deleted (the first one won't be deleted until the other patch for first instruction handling)

markus accepted this revision.Apr 25 2022, 10:50 PM
This revision is now accepted and ready to land.Apr 25 2022, 10:50 PM