[DAG] isKnownNeverZero - add ISD::SHL DemandedElts handling and tests
Needs to be updated now that https://github.com/llvm/llvm-project/pull/182679 has landed
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:
- 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.
- 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.
- Fix the issue locally.
- Run the test suite locally. Remember that the subdirectories under
test/create fine-grained testing targets, so you can e.g. usemake check-clang-astto only run Clang's AST tests. - Create a Git commit.
- Run
git clang-format HEAD~1to format your changes. - 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)
Hi @RKSimon i am new to llvm. I would like to start contributing to llvm. Could you pls confirm if the expected task is to use the new isKnownNeverZero with DemandedElts in the ISD::SHL case and write suitable test for it. If yes could you assign it to me
Yes, that's what it needs to do - unit tests will probably have to be added to AArch64SelectionDAGTest.cpp - please make sure you have a working llvm build and know how to run tests (ninja check-llvm-codegen) and unit tests (these can be run directly from unittests\Target\AArch64\AArch64Tests).
Hi @RKSimon please do check the submitted PR. Also I had set SHL by 32 for type i32 to be expected to be 0 in the tests. Please do tell if i should remove those cases as they are UB in C and C++