[PATCH] D115274: [IR][RFC] Memory region declaration intrinsic

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 13 15:27:19 PDT 2022


lebedev.ri updated this revision to Diff 414962.
lebedev.ri added a comment.

Thanks for taking a look!

In D115274#3362337 <https://reviews.llvm.org/D115274#3362337>, @nlopes wrote:

> This concept of sub-objects also shows up in the 'restrict' stuff. The difference is that with 'restrict' the aliasing constraints are dynamic: the promise is that e.g. two (dynamic) accesses in the original program don't alias. Here the constrains are static.
>
> Ideally we would have a single solution for all this stuff, but instead right now we have multiple disjoint solutions. Each one will have to go through the pain of patching all optimizers so they understand the new intrinsics so they don't throttle back. It's not ideal..

Right.

> I just wish we could sit physically in some place for a few days and work on a solution once and for all.



> It's also very hard to discuss designs when so much code has been written already (especially for the 'restrict' stuff).

FWIW, currently i don't have any further code for this.

> Regarding this patch in particular, I would mention that the storage of the returned sub-object is shared with the parent object, just to make it explicit. The concept looks ok.

Done.

> Again, my concern is that to be able to use this new intrinsic from clang by default will take a lot of work. You'll likely face many perf regressions before patching a bunch of optimizations.

I acknowledge this reality. I'm just not sure we have a better approach than that,
it would be good to come up with a "a solution once and for all",
but i'm not sure how that would look.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115274/new/

https://reviews.llvm.org/D115274

Files:
  llvm/docs/LangRef.rst
  llvm/include/llvm/IR/Intrinsics.td
  llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/test/CodeGen/AMDGPU/GlobalISel/memory_region_decl.ll
  llvm/test/CodeGen/X86/memory_region_decl.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115274.414962.patch
Type: text/x-patch
Size: 8054 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220313/ee07c90f/attachment.bin>


More information about the llvm-commits mailing list