This is an archive of the discontinued LLVM Phabricator instance.

[instcombine] Test for zero initialisation optimisation of integer product
ClosedPublic

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

Details

Summary

Following the work on D131672 we do the same optimisations for integer products.
We add tests to check if a loop gets removed if we repeatdly multiply an array elements with an accumulator initalised to zero

Diff Detail

Event Timeline

zjaffal created this revision.Aug 24 2022, 6:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2022, 6:17 AM
zjaffal requested review of this revision.Aug 24 2022, 6:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2022, 6:17 AM
fhahn added a comment.Aug 24 2022, 6:27 AM

Thanks for covering the integer case as well. It might be good to rename llvm/test/Transforms/InstCombine/remove-loop-phi-fastmul.ll to something like llvm/test/Transforms/InstCombine/remove-loop-phi-multiply-by-zero.ll or something, as -fastmul still carries a hint to fast FP math.

zjaffal updated this revision to Diff 455210.Aug 24 2022, 7:47 AM

rename file

fhahn accepted this revision.Aug 24 2022, 7:48 AM

LGTM, thanks!

This revision is now accepted and ready to land.Aug 24 2022, 7:48 AM
This revision was landed with ongoing or failed builds.Aug 24 2022, 7:54 AM
This revision was automatically updated to reflect the committed changes.