diff options
author | Yevgeny Rouban <yrouban@azul.com> | 2021-05-27 09:01:55 +0700 |
---|---|---|
committer | Yevgeny Rouban <yrouban@azul.com> | 2021-05-27 09:14:14 +0700 |
commit | 4d26f41f76c4f92023c02ec96ffbd02a6eb2c46d (patch) | |
tree | 35cf721359f97c8dc678b7c86619b473bc266046 /llvm/lib/IR/Module.cpp | |
parent | a4b61c82cf1a45c172af2e0242f5019281de14f8 (diff) | |
download | llvm-4d26f41f76c4f92023c02ec96ffbd02a6eb2c46d.zip llvm-4d26f41f76c4f92023c02ec96ffbd02a6eb2c46d.tar.gz llvm-4d26f41f76c4f92023c02ec96ffbd02a6eb2c46d.tar.bz2 |
[RS4GC] Introduce intrinsics to get base ptr and offset
There can be a need for some optimizations to get (base, offset)
for any GC pointer. The base can be calculated by generating
needed instructions as it is done by the
RewriteStatepointsForGC::findBasePointer() function. The offset
can be calculated in the same way. Though to not expose the base
calculation and to make the offset calculation as simple as
ptrtoint(derived_ptr) - ptrtoint(base_ptr), which is illegal
outside RS4GC, this patch introduces 2 intrinsics:
@llvm.experimental.gc.get.pointer.base(%derived_ptr)
@llvm.experimental.gc.get.pointer.offset(%derived_ptr)
These intrinsics are inlined by RS4GC along with generation of
statepoint sequences.
With these new intrinsics the GC parseable lowering for atomic
memcpy intrinsics (6ec2c5e402a724ba99bce82a9cac7a3006d660f4)
could be implemented as a separate pass.
Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D100445
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
0 files changed, 0 insertions, 0 deletions