This is an archive of the discontinued LLVM Phabricator instance.

[IR] Simplify createReplacementInstr
ClosedPublic

Authored by foad on Jun 11 2021, 8:46 AM.

Details

Summary

NFCI, although the test change shows that ConstantExpr::getAsInstruction
is better than the old implementation of createReplacementInstr because
it propagates things like the sdiv "exact" flag.

Diff Detail

Event Timeline

foad created this revision.Jun 11 2021, 8:46 AM
foad requested review of this revision.Jun 11 2021, 8:46 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 11 2021, 8:46 AM

Given how simple createReplacementInstr is now, this does make me wonder if it was really worth creating ReplaceConstant.{cpp,h} in the first place.

yaxunl accepted this revision.Jun 18 2021, 10:16 AM

LGTM. Thanks.

This revision is now accepted and ready to land.Jun 18 2021, 10:16 AM
This revision was automatically updated to reflect the committed changes.