This is an archive of the discontinued LLVM Phabricator instance.

[mlir][openacc] Add canonicalization pattern for acc.host_data
ClosedPublic

Authored by clementval on May 12 2023, 1:45 PM.

Details

Summary

Add if condition removal pattern for acc.host_data in a same way as
acc.enter_data, acc.exit_data and acc.update.

The condition is removed from the op if it is a true constant. If
it is a false constant then the region is inlined before the op
and the op is removed.

Diff Detail

Event Timeline

clementval created this revision.May 12 2023, 1:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2023, 1:45 PM
clementval requested review of this revision.May 12 2023, 1:45 PM
vzakhari accepted this revision.May 12 2023, 4:51 PM

LGTM. Thank you!

mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
328

nit: the braces are not needed.

This revision is now accepted and ready to land.May 12 2023, 4:51 PM
clementval added inline comments.May 12 2023, 4:55 PM
mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
328

Right. Thanks for catching. I had more code in there in a previous version. I'll update that before pushing.