Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new WeakVH value handle; NFC #6664

Open
wants to merge 6 commits into
base: user/zhengxing/Rename-WeakVH-upstream
Choose a base branch
from

Conversation

lizhengxing
Copy link
Collaborator

@lizhengxing lizhengxing commented May 31, 2024

This PR pulls 2 upstream changes, Add a new WeakVH value handle; NFC (llvm/llvm-project@f1c0eaf) and Use a 2 bit pointer in ValueHandleBase::PrevPair; NFC (llvm/llvm-project@b297bff), into DXC.

Here's the summary of the changes:

Add a new WeakVH value handle; NFC

  WeakVH nulls itself out if the value it was tracking gets deleted, but it does not track RAUW.

  Reviewers: dblaikie, davide

  Subscribers: mcrosier, llvm-commits

  Differential Revision: https://reviews.llvm.org/D32267

Use a 2 bit pointer in ValueHandleBase::PrevPair; NFC

This was an omission in r301813. I had made the supporting changes to make this happen, but I forgot to actually update the

PrevPair declaration.

This is part 4 and 5 of the fix for #6659.

This PR pulls the upstream change, Use accessors for ValueHandleBase::V; NFC (llvm/llvm-project@6f08789), into DXC.

Here's the summary of the change:
  This changes code that touches ValueHandleBase::V to go through getValPtr and (newly added) setValPtr.  This functionality will be used later, but also seemed like a generally good cleanup.

  I also renamed the field to Val, but that's just to make it obvious that I fixed all the uses.

This is part 1 of the fix for #6659.
This PR pulls the upstream change, Emulate TrackingVH using WeakVH (llvm/llvm-project@8a62382), into DXC.

Here's the summary of the change:

  This frees up one slot in the HandleBaseKind enum, which I will use later to add a new kind of value handle.  The size of the HandleBaseKind enum is important because we store a HandleBaseKind in
  the low two bits of a (in the worst case) 4 byte aligned pointer.

  Reviewers: davide, chandlerc

  Subscribers: mcrosier, llvm-commits

  Differential Revision: https://reviews.llvm.org/D32634

This is part 2 of the fix for #6659.
This PR pulls the upstream change, Rename WeakVH to WeakTrackingVH; NFC (llvm/llvm-project@e6bca0e), into DXC.

Here's the summary of the change:

  I plan to use WeakVH to mean "nulls itself out on deletion, but does not track RAUW" in a subsequent commit.

  Reviewers: dblaikie, davide

  Reviewed By: davide

  Subscribers: arsenm, mehdi_amini, mcrosier, mzolotukhin, jfb, llvm-commits, nhaehnle

  Differential Revision: https://reviews.llvm.org/D32266

This is part 3 of the fix for #6659.
This PR pulls the upstream change, UAdd a new WeakVH value handle; NFC (llvm/llvm-project@f1c0eaf), into DXC.

Here's the summary of the change:

  WeakVH nulls itself out if the value it was tracking gets deleted, but it does not track RAUW.

  Reviewers: dblaikie, davide

  Subscribers: mcrosier, llvm-commits

  Differential Revision: https://reviews.llvm.org/D32267

This is part 4 of the fix for #6659.
This PR pulls the upstream change, Use a 2 bit pointer in ValueHandleBase::PrevPair; NFC (llvm/llvm-project@b297bff), into DXC.

Here's the summary of the change:

  This was an omission in r301813.  I had made the supporting changes to make this happen, but I forgot to actually update the PrevPair declaration.

  llvm-svn: 301817

This is part 5 of the fix for #6659.
@lizhengxing lizhengxing requested a review from a team as a code owner May 31, 2024 17:16
Copy link
Contributor

github-actions bot commented May 31, 2024

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff e13c18bb4df451c30450929f6b8418cbcc592e46 2afad672de19b6f67b5b91779ad60d02c2473a47 -- include/llvm/IR/ValueHandle.h lib/IR/Value.cpp unittests/IR/ValueHandleTest.cpp
View the diff from clang-format here.
diff --git a/unittests/IR/ValueHandleTest.cpp b/unittests/IR/ValueHandleTest.cpp
index c38f80fe..5cdad74b 100644
--- a/unittests/IR/ValueHandleTest.cpp
+++ b/unittests/IR/ValueHandleTest.cpp
@@ -118,7 +118,6 @@ TEST_F(ValueHandle, WeakTrackingVH_NullOnDeletion) {
   EXPECT_EQ(null_value, WVH_Recreated);
 }
 
-
 TEST_F(ValueHandle, AssertingVH_BasicOperation) {
   AssertingVH<CastInst> AVH(BitcastV.get());
   CastInst *implicit_to_exact_type = AVH;
  • Check this box to apply formatting changes to this branch.

@lizhengxing lizhengxing changed the title User/zhengxing/add new weak vh upstream Add a new WeakVH value handle; NFC May 31, 2024
@lizhengxing lizhengxing force-pushed the user/zhengxing/Rename-WeakVH-upstream branch 2 times, most recently from cca3bbf to a776a77 Compare June 12, 2024 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

1 participant