This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Tighten the rules around folding TensorLoadOp
ClosedPublic

Authored by nicolasvasilache on Mar 4 2021, 8:31 AM.

Details

Summary

tensor_load(tensor_to_memref(x)) -> x is an incorrect folding because it ignores potential aliasing.

This revision approximates no-aliasing by restricting the folding to occur only when tensor_to_memref is immediately preceded by tensor_load in the same block. This is a conservative step back towards correctness until better alias analysis becomes available.

Context: https://llvm.discourse.group/t/properly-using-bufferization-related-passes/2913/6

Diff Detail

Event Timeline

nicolasvasilache requested review of this revision.Mar 4 2021, 8:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2021, 8:31 AM
ftynse accepted this revision.Mar 4 2021, 8:47 AM
This revision is now accepted and ready to land.Mar 4 2021, 8:47 AM
This revision was landed with ongoing or failed builds.Mar 4 2021, 9:49 AM
This revision was automatically updated to reflect the committed changes.