Page MenuHomePhabricator

[InstCombine] Adding testcase for Z / (1.0 / Y) => (Y * Z)
ClosedPublic

Authored by raghesh on Jan 8 2020, 1:36 AM.

Details

Summary

The added testcase shows the current transformation for the operation
Z / (1.0 / Y), which remains unchanged. This will be updated to align
with the transformed code (Y * Z) in a later patch.

The existing transformation Z / (X / Y) => (Y * Z) / X is not handling
this case as there are multiple uses for (1.0 / Y) in this testcase.

Diff Detail

Event Timeline

raghesh created this revision.Jan 8 2020, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 8 2020, 1:36 AM
spatel accepted this revision.Jan 8 2020, 7:08 AM
spatel removed a reviewer: llvm-commits.

LGTM - I'll try to push this on behalf of the author shortly.

This revision is now accepted and ready to land.Jan 8 2020, 7:08 AM
This revision was automatically updated to reflect the committed changes.
spatel added inline comments.Jan 8 2020, 7:45 AM
llvm/test/Transforms/InstCombine/fdiv.ll
200

I overlooked this earlier, but you probably want to change this from 'fast' to whatever the minimal flags are. It's fine to do that in the other patch/review if you want.

'arcp reassoc'?

raghesh marked an inline comment as done.Jan 8 2020, 11:08 PM
raghesh added inline comments.
llvm/test/Transforms/InstCombine/fdiv.ll
200

Changed 'fast' to 'arc reassoc' by creating a new revision https://reviews.llvm.org/D72431