-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[Support] Add KnownBits implementations for avgFloor and avgCeil #84640
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
Comments
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:
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)
Followup to #84211
These are implemented as part of #76644 but in SelectionDAG not in the KnownBits class directly
|
Hey @RKSimon, I would like to work on this. |
Hi I would like to work on this if this is available |
@changkhothuychung: Just create pull request and mention it on this page. |
@changkhothuychung @Sh0g0-1758 Both of you have requested assignment for #84640 and #84639 - do either of you have a preference? I'd prefer to keep the good-first-issue tickets distributed. |
I have started working on #84639 |
@RKSimon RK
|
KnownBits are for analysis to allow us to track whether any specific bits of a variable are guaranteed to be zero or one, and help considerably with codegen simplification. The implementations need moving into KnownBits.cpp - #76644 has the 4 implementations merged into 1 case, but ideally we'd want them separate. KnownBits::avgCeilS
KnownBits::avgCeilU
KnownBits::avgFloorS
KnownBits::avglFoorU The exhaustive tests will need to be added around here: llvm-project/llvm/unittests/Support/KnownBitsTest.cpp Lines 601 to 609 in 995d1d1
You will need to wait until #84431 is completed so the equivalent APInt constant methods are available. |
@changkhothuychung reverse-ping |
@RKSimon Hi, I am figuring out how to do the implementations, I will make a PR as soon as I have something. |
You can begin be converting the APInt expansions into KnownBits equivalents: llvm-project/llvm/lib/Support/APInt.cpp Lines 3105 to 3123 in 6f44bb7
|
This PR is to address the issue #84640
Fixed by #86445 ( we might be able to improve optimal testing in a future commit) |
@RKSimon And also, are all the code optimizations done at SelectionDAG level? Thanks. |
Most optimization is done in the middle end (InstCombine etc.), aiming for optimized, canonical code but very little is platform specific (just some combining of target intrinsics and some cost driven optimizations). The Instruction selection stage (SelectionDAG, FastISel, GlobalISel) then transforms the IR into types/ops suitable for a specific target: https://llvm.org/docs/CodeGenerator.html#introduction-to-selectiondags, and then converts to a DAG of target instructions and then MachineInstructions. |
Followup to #84211
These are implemented as part of #76644 but in SelectionDAG not in the KnownBits class directly
The text was updated successfully, but these errors were encountered: