This is an archive of the discontinued LLVM Phabricator instance.

[instcombine] Optimise for zero initialisation of integer product
AcceptedPublic

Authored by zjaffal on Aug 24 2022, 6:19 AM.

Details

Summary

Similar to the work on D131672 we optimise integer product if the accumlator value of a loop is initalised to zero

Diff Detail

Event Timeline

zjaffal created this revision.Aug 24 2022, 6:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2022, 6:19 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
zjaffal requested review of this revision.Aug 24 2022, 6:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2022, 6:19 AM
fhahn accepted this revision.Aug 24 2022, 6:28 AM
fhahn added reviewers: spatel, RKSimon.

LGTM, thanks!

This revision is now accepted and ready to land.Aug 24 2022, 6:28 AM
zjaffal updated this revision to Diff 455213.Aug 24 2022, 7:52 AM

edit file name

Note that "-ipsccp" already simplifies this example:
https://alive2.llvm.org/ce/z/WRqr2s

So I'm not sure if there's any practical benefit. It makes instcombine more uniform, so I don't object. We might also go in the other direction, but I don't know what it would take to make sccp FP-aware.