llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[X86] Add ComputeKnownBits support for BEXTR

Open RKSimon opened this issue 8 years ago • 6 comments

Bugzilla Link 39153
Version trunk
OS Windows NT
CC @adibiagio,@topperc,@LebedevRI,@rotateright
Fixed by commit(s) rG8ead5df0b119

Extended Description

Add ValueTracking and SelectionDAG ComputeKnownBits support for BEXTR intrinsics

RKSimon avatar Oct 02 '18 15:10 RKSimon

SelectionDAG support - rG8ead5df0b119

RKSimon avatar Feb 03 '20 16:02 RKSimon

Still need adding to ValueTracking.cpp computeKnownBitsFromOperator:

Intrinsic::x86_bmi_bextr_32
Intrinsic::x86_bmi_bextr_64
Intrinsic::x86_tbm_bextri_u32
Intrinsic::x86_tbm_bextri_u64

The implementation will be near-identical to the DAG version in X86TargetLowering.computeKnownBitsForTargetNode

RKSimon avatar May 16 '26 16:05 RKSimon

Hi!

This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:

  1. Check that no other contributor is working on this issue. If someone is assigned to the issue or claimed to be working on it, ping the person. After one week without a response, the assignee may be changed.
  2. Leave a comment indicating that you are working on the issue, or just create a pull request after following the steps below. Mention this issue in the description of the pull request.
  3. Fix the issue locally. Be aware that LLVM's AI policy forbids the use of AI tools to fix good first issues since it squanders a learning opportunity. Using LLMs to search and learn is permitted, since the goal is learning.
  4. Run the test suite locally. Remember that the subdirectories under test/ create fine-grained testing targets, so you can e.g. use make check-clang-ast to only run Clang's AST tests.
  5. Create a Git commit.
  6. Run git clang-format HEAD~1 to format your changes.
  7. Open a pull request to the upstream repository on GitHub. Detailed instructions can be found in GitHub's documentation. Mention this issue in the description of the pull request.

If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below.

@llvm/issue-subscribers-good-first-issue

Author: Simon Pilgrim (RKSimon)

| | | | --- | --- | | Bugzilla Link | [39153](https://llvm.org/bz39153) | | Version | trunk | | OS | Windows NT | | CC | @adibiagio,@topperc,@LebedevRI,@rotateright | | Fixed by commit(s) | rG8ead5df0b119 |

Extended Description

Add ValueTracking and SelectionDAG ComputeKnownBits support for BEXTR intrinsics

Hi @RKSimon I would like to work on this issue

ArihantChawla avatar May 24 '26 19:05 ArihantChawla

Hi @RKSimon I have raised a draft PR for this issue. I had a couple of questions which might be rather basic for which I apologize Firstly, I'm not able to see the bugzilla report mentioned in the issue, if there is something in the report which is missing in the issue comments please let me know. Secondly, I am not sure how to write the testcases for the issue, if you could direct me to some test cases of similar features I would be able to reporoduce them for this issue.

Here is the draft PR- #199558 , please let me know if any changes are needed as I am new to contributing to the project I might have missed something.

Thanks in advance

ArihantChawla avatar May 25 '26 17:05 ArihantChawla