Use ATTACH maps for array-sections/subscripts on pointers.#1
Closed
abhinavgaba wants to merge 10000 commits intotgt-capture-mapped-ptrs-by-reffrom
Closed
Use ATTACH maps for array-sections/subscripts on pointers.#1abhinavgaba wants to merge 10000 commits intotgt-capture-mapped-ptrs-by-reffrom
abhinavgaba wants to merge 10000 commits intotgt-capture-mapped-ptrs-by-reffrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the initial clang change to support using
ATTACHmap-type for pointer-attachment.This builds upon the following:
targetby reference. llvm/llvm-project#145454For example, for the following:
The following maps are now emitted by clang:
Previously, the two possible maps emitted by clang were:
(B) does not perform any pointer attachment, while (C) also maps the
pointer p, both of which are incorrect.
With this change, we are using ATTACH-style maps, like
(A), for cases where the expression has a base-pointer. For example:We also group mapping of clauses with the same base decl in the order of the increasing complexity of their base-pointers, e.g. for something like:
We first map
spp, thenspp[0]then spp[0][0] and spp[0][0].a.This allows us to also group "struct" allocation based on their attach pointers.
Cases that need handling:
pis a base-pointer in a map from a member function within the same class, p is not beingprivatized, instead, we still try to create an implicit map ofthis[0:1], and accesspthrough that, which is incorrect.use_device_addrclause does not work properly, because we don't have a proper component-list set-up for it, just one component, so we cannot find the proper attach-ptr. Foruse_device_addr, we should match existing maps whose attach-ptr matches the attach-ptr of theuse_device_addroperand.use_device_ptrhandling has some issues too. Need debugging.Some tests still haven't been updated. These include: