This is an archive of the discontinued LLVM Phabricator instance.

[llvm-reduce] Create returns with undef values for non-void functions.
ClosedPublic

Authored by fhahn on Aug 30 2020, 6:10 AM.

Details

Summary

Currently replaceBranchTerminator/removeUninterestingBBsFromSwitch
always creates ret void instructions if no successor is in the chunk.

This results in invalid IR for functions with non-void return types,
which makes those reductions unfeasible. Instead, create ret ty undef
for functions with non-void return types.

Diff Detail

Event Timeline

fhahn created this revision.Aug 30 2020, 6:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2020, 6:10 AM
Herald added a subscriber: danielkiss. · View Herald Transcript
fhahn requested review of this revision.Aug 30 2020, 6:10 AM
lebedev.ri added inline comments.Aug 30 2020, 6:17 AM
llvm/test/Reduce/remove-bbs-ret-nonvoid.ll
6

Please use FileCheck, like most new tests do

fhahn added inline comments.Aug 30 2020, 6:29 AM
llvm/test/Reduce/remove-bbs-ret-nonvoid.ll
6

Guess I copied from the wrong test then :D

fhahn updated this revision to Diff 288865.Aug 30 2020, 12:12 PM

Update test to use FileCheck for interestingness. Diff should now make the change clear, no switch required.

lebedev.ri accepted this revision.Aug 30 2020, 12:14 PM

LG, thanks

This revision is now accepted and ready to land.Aug 30 2020, 12:14 PM