This is an archive of the discontinued LLVM Phabricator instance.

[BufferDeallocation] Don't assume successor operands are unique
ClosedPublic

Authored by bkramer on Feb 17 2022, 4:56 AM.

Details

Summary

This would create a double free when a memref is passed twice to the
same op. This wasn't a problem at the time the pass was written but is
common since the introduction of scf.while.

There's a latent non-determinism that's triggered by the test, but this
change is messy enough as-is so I'll leave that for later.

Diff Detail

Event Timeline

bkramer created this revision.Feb 17 2022, 4:56 AM
bkramer requested review of this revision.Feb 17 2022, 4:56 AM
pifon2a accepted this revision.Feb 17 2022, 4:58 AM
This revision is now accepted and ready to land.Feb 17 2022, 4:58 AM
herhut accepted this revision.Feb 17 2022, 5:14 AM

Thanks!

mlir/lib/Dialect/Bufferization/Transforms/BufferDeallocation.cpp
387

This assert checks that the interface is implemented correctly, i.e., that successor inputs + beginoperandindex actually point to the right thing. Can you reflect this in the message somehow?

This revision was landed with ongoing or failed builds.Feb 17 2022, 5:16 AM
This revision was automatically updated to reflect the committed changes.