This is an archive of the discontinued LLVM Phabricator instance.

[fir] Add conversion patterns for slice, shape, shapeshift and shift ops
ClosedPublic

Authored by clementval on Nov 16 2021, 1:05 AM.

Details

Summary

The information in these perations is used by other operation.
At this point they should not have anymore uses.

This patch is part of the upstreaming effort from fir-dev branch.

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>

Diff Detail

Event Timeline

clementval created this revision.Nov 16 2021, 1:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2021, 1:05 AM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
clementval requested review of this revision.Nov 16 2021, 1:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 16 2021, 1:05 AM

Can you add a TODO to investigate why DCE leaves these ops around? If there is an original test case that will also be helpful for future investigation.

flang/lib/Optimizer/CodeGen/CodeGen.cpp
1394

Should this be a notify failure?

Can you add a TODO to investigate why DCE leaves these ops around? If there is an original test case that will also be helpful for future investigation.

AFAIK it does not leave them around. These conversion patterns are just here to make sure that at the end of this pass these ops have been made dead and removed.

flang/lib/Optimizer/CodeGen/CodeGen.cpp
1394

Yeah can switch to notifyMatchFailure. I'll add a invalid test as well.

Switch to notifyMatchFailure + add invalid tests

LGTM.

flang/lib/Optimizer/CodeGen/CodeGen.cpp
1382

Nit: If it is the pre-codegen pass that ensures this then it might be good to mention that here.

This revision is now accepted and ready to land.Nov 16 2021, 2:00 PM

Rebase + add comment

clementval marked 2 inline comments as done.Nov 17 2021, 1:22 AM