Skip to content

Provide access to raw bits in PackedVector. NFC. #98944

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

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

rampitec
Copy link
Collaborator

Needed for future patch to access vector as an integer mask.

Needed for future patch to access vector as an integer mask.
@rampitec rampitec requested review from akyrtzi and Sisyph July 15, 2024 18:47
@llvmbot
Copy link
Member

llvmbot commented Jul 15, 2024

@llvm/pr-subscribers-llvm-adt

Author: Stanislav Mekhanoshin (rampitec)

Changes

Needed for future patch to access vector as an integer mask.


Full diff: https://github.com/llvm/llvm-project/pull/98944.diff

1 Files Affected:

  • (modified) llvm/include/llvm/ADT/PackedVector.h (+2)
diff --git a/llvm/include/llvm/ADT/PackedVector.h b/llvm/include/llvm/ADT/PackedVector.h
index b448685ab6163..e837e140c03fc 100644
--- a/llvm/include/llvm/ADT/PackedVector.h
+++ b/llvm/include/llvm/ADT/PackedVector.h
@@ -141,6 +141,8 @@ class PackedVector : public PackedVectorBase<T, BitNum, BitVectorTy,
     Bits |= RHS.Bits;
     return *this;
   }
+
+  operator BitVectorTy() const { return Bits; }
 };
 
 // Leave BitNum=0 undefined.

Copy link
Contributor

@akyrtzi akyrtzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rampitec rampitec merged commit 466c1b6 into llvm:main Jul 15, 2024
5 of 6 checks passed
@rampitec rampitec deleted the packedvector-raw-bits branch July 15, 2024 21:35
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Summary: Needed for future patch to access vector as an integer mask.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251582
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants