User Details
- User Since
- Mar 8 2021, 10:08 PM (132 w, 5 d)
Aug 7 2022
- Rebase
- Simplified this patch
Jul 25 2022
Just JFYI :)
Yes, probably not worth it
JFYI @spatel As I see this is quite similar to issue 53482. I remember some efforts to move out marking tail calls to a separate pass so this should be cheaper to do marking once again (not sure to what extent). It was not landed earlier, but it was ready to land as I understand :)
Feb 5 2022
- Rebased
- If EnableOptimizationAcrossLoops is false, then DSE does not run twice
- Added two more negative tests cases
- Removed loop transformations from this pass
- Skip killing store which is not guaranteed to execute
Feb 2 2022
Dec 16 2021
Dec 12 2021
Nov 1 2021
Oct 5 2021
Hi, @xbolva00. Are you sure that we can use loop idiom and transform arbitrary loop with a store into let's a memset?
Results for current patch for SingleSource/MultiSource are in the table below. Other don't show any different. Metric is dse.RemainingNumStores
- Transform loops into loop rotated simplify form
- Use guards instead of directly finding icmps
- Implemented optimization for loop + loop
- Decreased the number of times when we compute range for memory intrinsics
- Running DSE loop twice, 1 as it was before and 2 for optimization across loops
Sep 27 2021
Loops lose simplify form in JumpThreading in default pipeline before DSE, for example. I don't know the details and if this is correct or not. There is currently no need for a loop to be in simplify form in DSE in order to work with it (except that it should be a natural loop). It became only required for my optimization.
Sep 26 2021
Sep 15 2021
- Simplified code by removing unnecessary if-statements
- Turned AddMemRange lambda to a method
- memset can be eliminated when memset has constant length and loop has constant iteration count + added a test for this
Sep 9 2021
@ebrevnov I see that in memoryIsNotModifiedBetween function and there is some sort of a local phi-translation (I mean it is used only inside this function) as I understand. Do we need to update this function somehow?
Sep 8 2021
Rebase + fixed opt-pipeline.ll tests for AMDGPU
- Added one test for a loop with several latches where we don't always overwrite the region where memory intrinsic writes to
- Fixed formatting
- Replaced typed pointers with opaque pointers (--force-opaque-pointers is used in tests)
- Fixed crash caused by an assertion for multiplication of operands with different types
- Optimized ContinuousMemoryRegion and removed one field from there
- Added a feature flag EnableMemIntrinsicEliminationByStores to enable/disable this feature at runtime (probably not the best naming)
Sep 4 2021
Jul 9 2021
Jun 28 2021
@ebrevnov
Hi, any progress on the patch? I'd like to work on it if you agreed to that.
Jun 18 2021
Jun 17 2021
Jun 15 2021
@lebedev.ri I don't have commit access
Jun 13 2021
We're going to see difference only in tests @mul_bool_sext_one_extra_user and mul_bool_sext_one_user as other transformations are performed even without the change in the patch. Can someone push baseline tests to show that in the diff?
- Added an equality check of operands (previously checked if they have exactly one user)
- Added more tests
I think I should update the patch because LLVM already handles zext
%sx = zext i1 %x to i32 %r = mul i32 %sx, %sx ret i32 %r
Jun 7 2021
Sorry, I didn't see you have already committed :)
Jun 6 2021
Removed name diff in tests
Jun 5 2021
@spatel Done
Jun 1 2021
@spatel you mentioned one more optimization with sext that we miss because of too strict use-constraint here. I'll create another patch for that. I think, it's going to be the last one. I don't know any other transformations for mul/fmul that would benefit from the new method.
- Replaced hasOneUse + equality of operands with isOnlyUserOfAnyOperand
- FMF are added to produced fadd
- Added negative tests
I ask someone to commit the patch if there are no any barriers left for that (Roman's agreement?). I don't have commit access.
May 27 2021
Waiting for approval of other reviewers
Rebasing + updated tests with multiple uses in fmul
May 25 2021
isOnlyUserOfAnyOperand uses hasOneUser to figure out if at least one of ops has only one user
May 24 2021
Moved isOnlyUserOfAnyOperand to Instruction class
As I understand it
Removed irrelevant comments
Replaced std::any_of with llvm::any_of and used I->operands() instead of making range directly via begin/end
May 19 2021
Updating diff
- Fixed warnings of clang-tidy
- Refactored implementation for this patch
May 18 2021
I created a new patch https://reviews.llvm.org/D102698. I will update the current patch when we close the new one.
May 17 2021
I have noticed that there are two similiar transformations below exp2(X) * exp2(Y) -> exp2(X + Y) and exp(X) * exp(Y) -> exp(X + Y) that are done when each operand of multiplication has exactly one use which is n't true if, for example, there is exp2(X) * exp2(X) where exp2(X) is the same instruction, so it can be improved a little. I'm going to update the patch
May 16 2021
Calling CreateBinaryIntrinsic instead of CreateIntrinsic for better readability
May 1 2021
@reames, I don't have commit access. Can you commit the patch?