Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

[MemRefToLLVM] Add a method in MemRefDescriptor to get the buffer addr

Authored by qcolombet on Apr 21 2023, 11:30 AM.



This patch pushes the computation of the start address of a memref in one
place (a method in MemRefDescriptor.)

This allows all the (indirect) users of this method to produce the start
address in the same way.

Thanks to this change, we expose more CSEs opportunities and thanks to
that, the backend is able to properly find the llvm.assume expression
related to the base address as demonstrated in the added test.

Diff Detail

Event Timeline

qcolombet created this revision.Apr 21 2023, 11:30 AM
Herald added a project: Restricted Project. · View Herald Transcript
qcolombet requested review of this revision.Apr 21 2023, 11:30 AM
mravishankar accepted this revision.Apr 21 2023, 1:37 PM

This is good too! Thanks!

This revision is now accepted and ready to land.Apr 21 2023, 1:37 PM

nit: can we turn this into an early exit?

if (offsetCst == 0)
  return ptr;

qcolombet marked an inline comment as done.May 16 2023, 1:59 AM
qcolombet added inline comments.