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

[X86] checkSignTestSetCCCombine - handle SIGN_EXTEND_INREG / SHL patterns inside CMP(X,0) cases

Open RKSimon opened this issue 10 months ago • 4 comments

Mentioned here https://github.com/llvm/llvm-project/pull/164946/changes#r2664612865 in the is_negsubnormal_f80 test case

When expanding signbit tests to a regular TEST(X,C) eq/ne pattern, we currently only peek through CMP(SRA(X,Y),0) -> X patterns.

But both SIGN_EXTEND_INREG(X) and SHL(X,Constant) patterns can be expanded as well with a suitable bitmask.

RKSimon avatar Jan 27 '26 16:01 RKSimon

@llvm/issue-subscribers-backend-x86

Author: Simon Pilgrim (RKSimon)

Mentioned here https://github.com/llvm/llvm-project/pull/164946/changes#r2664612865 in the `is_negsubnormal_f80` test case

When expanding signbit tests to a regular TEST(X,C) eq/ne pattern, we currently we only peek through CMP(SRA(X,Y),0) -> X patterns.

But both SIGN_EXTEND_INREG(X) and SHL(X,Constant) patterns can be expanded as well with a suitable bitmask.

llvmbot avatar Jan 27 '26 16:01 llvmbot

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.
  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.

llvmbot avatar Jan 27 '26 16:01 llvmbot

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

Author: Simon Pilgrim (RKSimon)

Mentioned here https://github.com/llvm/llvm-project/pull/164946/changes#r2664612865 in the `is_negsubnormal_f80` test case

When expanding signbit tests to a regular TEST(X,C) eq/ne pattern, we currently we only peek through CMP(SRA(X,Y),0) -> X patterns.

But both SIGN_EXTEND_INREG(X) and SHL(X,Constant) patterns can be expanded as well with a suitable bitmask.

llvmbot avatar Jan 27 '26 16:01 llvmbot

@RKSimon
Can I work on this

Abhiramjampani avatar Jan 27 '26 16:01 Abhiramjampani