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

getNegatedExpression should handle FP16_TO_FP and FP_TO_FP16

Open arsenm opened this issue 10 months ago • 15 comments

getNegatedExpression does not handle the opcodes FP16_TO_FP and FP_TO_FP16, but it could. This could improve use of source modifiers on AMDGPU with illegal f16.

I started implementing it in this patch, but it requires additional work to avoid regressions.

0001-DAG-Implement-getNegatedExpression-for-FP16_TO_FP.patch

arsenm avatar Jan 22 '26 19:01 arsenm

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 23 '26 18:01 llvmbot

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

Author: Matt Arsenault (arsenm)

[getNegatedExpression](https://github.com/llvm/llvm-project/blob/e89a99e26db168f99e928f6a82cab0df13a77c96/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp#L7556) does not handle the opcodes FP16_TO_FP and FP_TO_FP16, but it could. This could improve use of source modifiers on AMDGPU with illegal f16.

I started implementing it in this patch, but it requires additional work to avoid regressions.

0001-DAG-Implement-getNegatedExpression-for-FP16_TO_FP.patch

llvmbot avatar Jan 23 '26 18:01 llvmbot

@arsenm can i work on this?

Xylecrack avatar Jan 23 '26 20:01 Xylecrack

Sure, go ahead

arsenm avatar Jan 23 '26 20:01 arsenm

Hi @arsenm quick clarification, is implementing FP_TO_FP16 part of this issue, or should the initial fix focus only on FP16_TO_FP?

Xylecrack avatar Jan 24 '26 13:01 Xylecrack

Can do in either order. I suspect to avoid all regressions this will need both to be handled

arsenm avatar Jan 24 '26 13:01 arsenm

Hi @Xylecrack , are you still actively working on this? If not, I’d be happy to take it over

Aditya26189 avatar Jan 30 '26 03:01 Aditya26189

Hi @Aditya26189 I’m still working on this. I will open a draft PR soon.

Xylecrack avatar Jan 30 '26 04:01 Xylecrack

I can’t make further progress on this. Feel free to take it up.

Xylecrack avatar Feb 16 '26 13:02 Xylecrack

Hi, I’d like to work on this issue.

shrav784 avatar Mar 02 '26 05:03 shrav784

Hi, Is this issue still open? I would like to work on it.

VatsalKhosla avatar Mar 08 '26 10:03 VatsalKhosla

Hi, I'd like to pick this up, I have the changes, I'll raise the PR.

HalfBloodPrince010 avatar Jul 31 '26 04:07 HalfBloodPrince010

Hi, is this issue open? I'd like to work on it.

Dash198 avatar Oct 17 '26 20:10 Dash198

Hi @Dash198 Good day! I already have a PR out for this: https://github.com/llvm/llvm-project/pull/213202.

HalfBloodPrince010 avatar Oct 18 '26 14:10 HalfBloodPrince010

Hi, no issues and thanks for the heads-up!

Dash198 avatar Oct 18 '26 14:10 Dash198