Page MenuHomePhabricator
Feed Advanced Search

Today

ebrevnov added a comment to D88287: [NARY-REASSOCIATE] Support reassociation of min/max.

commit 13a5cac2ba919b4d02a296428b58919231e08569 (HEAD -> main, origin/main)
Author: Evgeniy Brevnov <ybrevnov@azul.com>
Date: Fri Feb 26 19:23:32 2021 +0700

Fri, Feb 26, 4:49 AM · Restricted Project
ebrevnov added a comment to D88287: [NARY-REASSOCIATE] Support reassociation of min/max.

I think it's better to revert it for now. Looks like the topic is not that trivial and we should first agree on the fix. There is no need to hurry.

Fri, Feb 26, 4:29 AM · Restricted Project
ebrevnov added a comment to D88287: [NARY-REASSOCIATE] Support reassociation of min/max.

No.

Like i have already said, the fix is https://alive2.llvm.org/ce/z/RkBWxC.
Let me just fix this then.

Fri, Feb 26, 3:59 AM · Restricted Project
ebrevnov added a comment to D88287: [NARY-REASSOCIATE] Support reassociation of min/max.

I think the solution is to use >= instead of > when we do min/max reassociation. In other words, originally we had 'any' > MAX_INT which is known to be false. If we want semantically equal but reassociated expression we should invert the comparison logic. In other words we should check MAX_INT >= 'any' which is known to be true and MAX_INT will be selected.

Fri, Feb 26, 3:19 AM · Restricted Project
ebrevnov added a comment to D88287: [NARY-REASSOCIATE] Support reassociation of min/max.

Just to add to what Roman wrote, thinking of the code as max(,) is misleading. The code is doing icmp sgt INT_MAX, undef which can evaluate to true or false. But we cannot assume that undef from now on is equal to INT_MAX just because the comparison evaluated to true.

Fri, Feb 26, 2:48 AM · Restricted Project
ebrevnov added a comment to D88287: [NARY-REASSOCIATE] Support reassociation of min/max.

I think I understand the problem now. 'any'>max_int is known to be false (first case), while max_int >'any' is unknown (second case)....so this is not verification issue....

Fri, Feb 26, 2:36 AM · Restricted Project
ebrevnov added a comment to D88287: [NARY-REASSOCIATE] Support reassociation of min/max.

I think this is an issue of verification itself. In the first case max(0, undef)=>any and max(any, max_int)=>max_int. In the second case max(max_int, undef)=>x03002006. I believe the behavior of the verifier is inconsistent in these two cases and max(max_int, undef) should be evaluated to max_int as well. We can do the following trivial transformations to prove that: max(max_int, undef) is trivially equal to max(max_int, max(undef, undef)) and max(undef, undef) should be evaluated to 'any' since max(0, undef) is evaluated to 'any' in the first case. Thus we get max(max_int, any) which is evaluated to 'max_int' in the first case. So max(max_int, undef) should be evaluated to 'max_int' but not 'x03002006'.

Makes sense?

Note that given

%a = undef
%b = %a

, %a and %b have undefined values, and there are no guarantees that they are equal/not equal.
Since you emitted icmp+select, you 'read' from undefined %c twice, and you are free to get different result each time.

Fri, Feb 26, 2:21 AM · Restricted Project

Yesterday

ebrevnov added a comment to D88287: [NARY-REASSOCIATE] Support reassociation of min/max.

I think this is an issue of verification itself. In the first case max(0, undef)=>any and max(any, max_int)=>max_int. In the second case max(max_int, undef)=>x03002006. I believe the behavior of the verifier is inconsistent in these two cases and max(max_int, undef) should be evaluated to max_int as well. We can do the following trivial transformations to prove that: max(max_int, undef) is trivially equal to max(max_int, max(undef, undef)) and max(undef, undef) should be evaluated to 'any' since max(0, undef) is evaluated to 'any' in the first case. Thus we get max(max_int, any) which is evaluated to 'max_int' in the first case. So max(max_int, undef) should be evaluated to 'max_int' but not 'x03002006'.

Thu, Feb 25, 7:52 PM · Restricted Project
ebrevnov added inline comments to D88287: [NARY-REASSOCIATE] Support reassociation of min/max.
Thu, Feb 25, 3:13 AM · Restricted Project
ebrevnov updated the diff for D88287: [NARY-REASSOCIATE] Support reassociation of min/max.

Update

Thu, Feb 25, 2:53 AM · Restricted Project
ebrevnov updated the diff for D88287: [NARY-REASSOCIATE] Support reassociation of min/max.

Addressed comments

Thu, Feb 25, 12:31 AM · Restricted Project

Wed, Feb 24

ebrevnov accepted D75980: [LV] Generate RT checks up-front and remove them if required..

LGTM.

Wed, Feb 24, 7:34 PM · Restricted Project
ebrevnov added a comment to D75980: [LV] Generate RT checks up-front and remove them if required..

Thanks for doing the changes. Overall this version looks fine to me. Please go ahead with some final cleanups.

Wed, Feb 24, 1:53 AM · Restricted Project

Thu, Feb 18

ebrevnov added a comment to D93530: [DSE] Add support for not aligned begin/end.

I appreciate your time to review and experimenting with the patch. I agree it's kind of unexpected to see less stores get removed. Would it be possible for you to share an IR where that happens (not reduced one is fine)? I'm asking for this because I don't have access to those SPECs.

Thu, Feb 18, 4:38 AM · Restricted Project

Wed, Feb 17

ebrevnov added inline comments to D75980: [LV] Generate RT checks up-front and remove them if required..
Wed, Feb 17, 2:55 AM · Restricted Project

Tue, Feb 16

ebrevnov added a comment to D75980: [LV] Generate RT checks up-front and remove them if required..

I started looking into this... Hopefully, will be able to provide my feedback by tomorrow.

Tue, Feb 16, 8:36 AM · Restricted Project

Wed, Feb 10

ebrevnov added a reviewer for D75980: [LV] Generate RT checks up-front and remove them if required.: ebrevnov.
Wed, Feb 10, 4:31 AM · Restricted Project

Sat, Feb 6

ebrevnov added a comment to D75980: [LV] Generate RT checks up-front and remove them if required..

I'm going to take a look next week if nobody outstrip me...

Sat, Feb 6, 1:27 AM · Restricted Project

Jan 11 2021

ebrevnov added a comment to D93530: [DSE] Add support for not aligned begin/end.

ping

Jan 11 2021, 3:52 AM · Restricted Project

Dec 24 2020

ebrevnov added a comment to D93682: [CodeGen] Add "noreturn" attirbute to _Unwind_Resume.

Yes. Please review proposed fix https://reviews.llvm.org/D93803. Evgeniy

Dec 24 2020, 5:01 AM · Restricted Project
ebrevnov added reviewers for D93803: Moved dwarf_eh_resume.ll from Generic to X86 folder: xbolva00, thakis.
Dec 24 2020, 5:00 AM · Restricted Project
ebrevnov requested review of D93803: Moved dwarf_eh_resume.ll from Generic to X86 folder.
Dec 24 2020, 4:58 AM · Restricted Project
ebrevnov updated subscribers of D93682: [CodeGen] Add "noreturn" attirbute to _Unwind_Resume.

Thanks for letting me know. Looking now...

Dec 24 2020, 4:24 AM · Restricted Project
ebrevnov updated the diff for D93682: [CodeGen] Add "noreturn" attirbute to _Unwind_Resume.

Updated test case due to https://reviews.llvm.org/D79485 has landed.

Dec 24 2020, 12:12 AM · Restricted Project

Dec 23 2020

ebrevnov requested changes to D86017: [BPI] Improve static heuristics for integer comparisons with CST and non-CST.
Dec 23 2020, 7:24 AM · Restricted Project
ebrevnov updated the diff for D79485: [BPI] Improve static heuristics for "cold" paths..

Rebase

Dec 23 2020, 7:12 AM · Restricted Project
ebrevnov updated the diff for D79485: [BPI] Improve static heuristics for "cold" paths..

Rebase

Dec 23 2020, 7:09 AM · Restricted Project
ebrevnov updated the diff for D79485: [BPI] Improve static heuristics for "cold" paths..

Addressed comments

Dec 23 2020, 6:56 AM · Restricted Project
ebrevnov updated the summary of D93682: [CodeGen] Add "noreturn" attirbute to _Unwind_Resume.
Dec 23 2020, 3:02 AM · Restricted Project
ebrevnov updated the diff for D93682: [CodeGen] Add "noreturn" attirbute to _Unwind_Resume.

Added test case.

Dec 23 2020, 2:53 AM · Restricted Project

Dec 22 2020

ebrevnov added inline comments to D79485: [BPI] Improve static heuristics for "cold" paths..
Dec 22 2020, 3:07 AM · Restricted Project
ebrevnov requested review of D93682: [CodeGen] Add "noreturn" attirbute to _Unwind_Resume.
Dec 22 2020, 3:07 AM · Restricted Project
ebrevnov updated the diff for D79485: [BPI] Improve static heuristics for "cold" paths..

Addressed comments

Dec 22 2020, 3:05 AM · Restricted Project

Dec 20 2020

ebrevnov added a comment to D93530: [DSE] Add support for not aligned begin/end.

I had already tried to measure performance with the test-suite previously with out success. This time again I observe big variation. I'm using dedicated performance machine which runs only my process. I've build test-suite as follows:

Dec 20 2020, 11:55 PM · Restricted Project

Dec 18 2020

ebrevnov updated the diff for D93530: [DSE] Add support for not aligned begin/end.

Initial update

Dec 18 2020, 3:44 AM · Restricted Project
ebrevnov updated the summary of D93530: [DSE] Add support for not aligned begin/end.
Dec 18 2020, 2:59 AM · Restricted Project
ebrevnov requested review of D93530: [DSE] Add support for not aligned begin/end.
Dec 18 2020, 2:43 AM · Restricted Project

Dec 4 2020

ebrevnov added a reviewer for D92648: [DSE][NFC] Need to be carefull mixing signed and unsigned types: fhahn.
Dec 4 2020, 3:20 AM · Restricted Project
ebrevnov updated the diff for D92648: [DSE][NFC] Need to be carefull mixing signed and unsigned types.

Updated comments

Dec 4 2020, 3:20 AM · Restricted Project
ebrevnov requested review of D92648: [DSE][NFC] Need to be carefull mixing signed and unsigned types.
Dec 4 2020, 3:09 AM · Restricted Project
ebrevnov abandoned D72832: [NFC][LoopUtils] Added regression test for getEstimatedTripCount..
Dec 4 2020, 2:30 AM · Restricted Project

Dec 3 2020

ebrevnov updated the diff for D88285: [NARY-REASSOCIATE] Simplify traversal logic by post deleting dead instructions.

Rebase

Dec 3 2020, 4:21 AM · Restricted Project
ebrevnov accepted D92566: [NFC][Tests] Added one additional test case for NaryRessociation pass..
Dec 3 2020, 4:05 AM · Restricted Project
ebrevnov updated the summary of D92566: [NFC][Tests] Added one additional test case for NaryRessociation pass..
Dec 3 2020, 4:05 AM · Restricted Project
ebrevnov requested review of D92566: [NFC][Tests] Added one additional test case for NaryRessociation pass..
Dec 3 2020, 4:03 AM · Restricted Project
ebrevnov updated the diff for D88287: [NARY-REASSOCIATE] Support reassociation of min/max.

Rebase

Dec 3 2020, 3:18 AM · Restricted Project
ebrevnov updated the diff for D88286: [NFC][NARY-REASSOCIATE] Restructure code to aviod isPotentiallyReassociatable.

Rebase

Dec 3 2020, 3:16 AM · Restricted Project
ebrevnov updated the diff for D88286: [NFC][NARY-REASSOCIATE] Restructure code to aviod isPotentiallyReassociatable.

Rebase

Dec 3 2020, 3:06 AM · Restricted Project
ebrevnov updated the diff for D88285: [NARY-REASSOCIATE] Simplify traversal logic by post deleting dead instructions.

Rebase

Dec 3 2020, 3:03 AM · Restricted Project
ebrevnov added a reviewer for D92561: [NFC][Tests] Auto generate checks for llvm/test/Transforms/NaryReassociate/pr24301.ll using update_test_checks.py: mkazantsev.
Dec 3 2020, 3:00 AM · Restricted Project
ebrevnov requested review of D92561: [NFC][Tests] Auto generate checks for llvm/test/Transforms/NaryReassociate/pr24301.ll using update_test_checks.py.
Dec 3 2020, 3:00 AM · Restricted Project

Dec 2 2020

ebrevnov added inline comments to D88287: [NARY-REASSOCIATE] Support reassociation of min/max.
Dec 2 2020, 2:39 AM · Restricted Project
ebrevnov added inline comments to D88285: [NARY-REASSOCIATE] Simplify traversal logic by post deleting dead instructions.
Dec 2 2020, 2:26 AM · Restricted Project

Nov 12 2020

ebrevnov added a reviewer for D91325: [IndVarSimplify] Notify top most loop to drop cached exit counts: mkazantsev.
Nov 12 2020, 1:25 AM · Restricted Project

Nov 2 2020

ebrevnov accepted D88210: [IndVars] Use knowledge about execution on last iteration when removing checks.

LGTM

Nov 2 2020, 10:15 PM · Restricted Project

Oct 30 2020

ebrevnov requested changes to D88210: [IndVars] Use knowledge about execution on last iteration when removing checks.
Oct 30 2020, 3:18 AM · Restricted Project
ebrevnov accepted D88210: [IndVars] Use knowledge about execution on last iteration when removing checks.

LGTM. But let chance for others to comment. Thanks.

Oct 30 2020, 3:04 AM · Restricted Project
ebrevnov added inline comments to D88210: [IndVars] Use knowledge about execution on last iteration when removing checks.
Oct 30 2020, 2:03 AM · Restricted Project

Oct 29 2020

ebrevnov added a comment to D90371: [DSE] Improve partial overlap detection.

This LGTM.
I'd like to understand better what you mean by not calling partialOverwrite. If the functionality in that call would be included in the isOverwrite call, note that there are call-paths that would do more work than they do now, and I thought there was a previous refactoring done to avoid this.

Oct 29 2020, 11:40 PM · Restricted Project
ebrevnov added a comment to D90095: [WIP][DSE] Enable MSSA DSE to optimize across PHIs.

This currently seems to lead to a bit less stores removed overall on MultiSource/SPEC2000/SPEC2006 with -O3 -flto, but that might be related to some of the limits needing adjustments.

I found PartialLimit preventing DSE to optimize one of my simple cases. Here is the fix https://reviews.llvm.org/D90371 which I believe is beneficial regardless.

Oct 29 2020, 2:08 AM · Restricted Project
ebrevnov updated the summary of D90371: [DSE] Improve partial overlap detection.
Oct 29 2020, 1:52 AM · Restricted Project
ebrevnov requested review of D90371: [DSE] Improve partial overlap detection.
Oct 29 2020, 1:48 AM · Restricted Project

Oct 28 2020

ebrevnov added a reviewer for D88287: [NARY-REASSOCIATE] Support reassociation of min/max: mkazantsev.
Oct 28 2020, 10:00 PM · Restricted Project
ebrevnov added a reviewer for D88286: [NFC][NARY-REASSOCIATE] Restructure code to aviod isPotentiallyReassociatable: mkazantsev.
Oct 28 2020, 9:59 PM · Restricted Project
ebrevnov added a reviewer for D88285: [NARY-REASSOCIATE] Simplify traversal logic by post deleting dead instructions: mkazantsev.
Oct 28 2020, 9:59 PM · Restricted Project

Oct 27 2020

ebrevnov added a comment to D90095: [WIP][DSE] Enable MSSA DSE to optimize across PHIs.

Thanks for giving it a try!

Oct 27 2020, 8:34 AM · Restricted Project
ebrevnov added inline comments to D88210: [IndVars] Use knowledge about execution on last iteration when removing checks.
Oct 27 2020, 7:22 AM · Restricted Project

Oct 26 2020

ebrevnov updated the diff for D90095: [WIP][DSE] Enable MSSA DSE to optimize across PHIs.

Rename DefLoc to ResDefLoc to fix name conflict.

Oct 26 2020, 1:21 AM · Restricted Project

Oct 24 2020

ebrevnov added a comment to D72148: [DSE] Support traversing MemoryPhis..

Yeah there have been some substantial changes to the way we find the candidates to remove, but I think the same idea should still apply. It would be ideal to update & rebase the patch, but if you won't have time to do so it would be great if you could share the older version regardless.

Rebased and uploaded here https://reviews.llvm.org/D90095

Oct 24 2020, 5:18 AM · Restricted Project
ebrevnov updated subscribers of D90095: [WIP][DSE] Enable MSSA DSE to optimize across PHIs.
Oct 24 2020, 5:14 AM · Restricted Project
ebrevnov requested review of D90095: [WIP][DSE] Enable MSSA DSE to optimize across PHIs.
Oct 24 2020, 5:12 AM · Restricted Project

Oct 20 2020

ebrevnov accepted D89773: [IRCE] consolidate profitability check.

LGTM with a nit.

Oct 20 2020, 2:40 AM · Restricted Project

Oct 19 2020

ebrevnov added inline comments to D89541: [IRCE] Do not transform is loop has small number of iterations.
Oct 19 2020, 6:56 AM · Restricted Project

Oct 18 2020

ebrevnov updated subscribers of D89541: [IRCE] Do not transform is loop has small number of iterations.
Oct 18 2020, 10:32 PM · Restricted Project
ebrevnov added a comment to D89541: [IRCE] Do not transform is loop has small number of iterations.

I think it makes sense to introduce the proposed heuristic since there is no easy way to estimate cost of the code generated by SCEVExpander at the moment.

Oct 18 2020, 10:31 PM · Restricted Project

Oct 12 2020

ebrevnov added inline comments to D87679: [LV] Unroll factor is expected to be > 0.
Oct 12 2020, 9:48 PM · Restricted Project
ebrevnov added inline comments to D87679: [LV] Unroll factor is expected to be > 0.
Oct 12 2020, 1:04 AM · Restricted Project
ebrevnov updated the diff for D87679: [LV] Unroll factor is expected to be > 0.

Fixed according to Ayal's request.

Oct 12 2020, 1:04 AM · Restricted Project

Oct 9 2020

ebrevnov added a comment to D87679: [LV] Unroll factor is expected to be > 0.

Does this look fine?

Oct 9 2020, 5:21 AM · Restricted Project
ebrevnov updated the diff for D87679: [LV] Unroll factor is expected to be > 0.

Sanitize MaxIC upfront.

Oct 9 2020, 5:20 AM · Restricted Project

Sep 30 2020

ebrevnov added a comment to D88285: [NARY-REASSOCIATE] Simplify traversal logic by post deleting dead instructions.

ping

Sep 30 2020, 9:29 PM · Restricted Project
ebrevnov abandoned D73697: [LoopPredication] Optimize two exits case..

It turned out that in the targeted case there is the following expression min(a,b) = min(min(a,c), b) where rhs min is reassociated. Due to this foldICmpWithMinMax can't handle it. I've uploaded a series of 3 patched for NaryReassociate (https://reviews.llvm.org/D88285, https://reviews.llvm.org/D88286, https://reviews.llvm.org/D88287) which converts that to min(a,b) = min(min(a,b), c). With that in place foldICmpWithMinMax does its job.

Sep 30 2020, 9:29 PM · Restricted Project
ebrevnov added a comment to D79485: [BPI] Improve static heuristics for "cold" paths..

ping

Sep 30 2020, 8:32 PM · Restricted Project
ebrevnov added inline comments to D87679: [LV] Unroll factor is expected to be > 0.
Sep 30 2020, 8:32 PM · Restricted Project

Sep 27 2020

ebrevnov added a comment to D87679: [LV] Unroll factor is expected to be > 0.

LGTM, thanks. Suggestion inline, but quite subjective, so feel free to ignore.

Sep 27 2020, 11:09 PM · Restricted Project

Sep 25 2020

ebrevnov added a reviewer for D88287: [NARY-REASSOCIATE] Support reassociation of min/max: jingyue.
Sep 25 2020, 1:57 AM · Restricted Project
ebrevnov added a reviewer for D88286: [NFC][NARY-REASSOCIATE] Restructure code to aviod isPotentiallyReassociatable: jingyue.
Sep 25 2020, 1:57 AM · Restricted Project
ebrevnov requested review of D88287: [NARY-REASSOCIATE] Support reassociation of min/max.
Sep 25 2020, 1:56 AM · Restricted Project
ebrevnov requested review of D88286: [NFC][NARY-REASSOCIATE] Restructure code to aviod isPotentiallyReassociatable.
Sep 25 2020, 1:53 AM · Restricted Project
ebrevnov added a reviewer for D88285: [NARY-REASSOCIATE] Simplify traversal logic by post deleting dead instructions: jingyue.
Sep 25 2020, 1:45 AM · Restricted Project
ebrevnov requested review of D88285: [NARY-REASSOCIATE] Simplify traversal logic by post deleting dead instructions.
Sep 25 2020, 1:42 AM · Restricted Project

Sep 24 2020

ebrevnov added a comment to D87679: [LV] Unroll factor is expected to be > 0.

@fhahn ping

Sep 24 2020, 8:07 PM · Restricted Project

Sep 21 2020

ebrevnov added a comment to D72148: [DSE] Support traversing MemoryPhis..

Hi @ebrevnov,

I just wanted to briefly check in to see if you made any progress on this or if you think it is worth adding a bug report to keep track of the improvement?

Sep 21 2020, 10:10 PM · Restricted Project

Sep 16 2020

ebrevnov updated the summary of D79485: [BPI] Improve static heuristics for "cold" paths..
Sep 16 2020, 10:19 PM · Restricted Project

Sep 15 2020

ebrevnov updated the diff for D87679: [LV] Unroll factor is expected to be > 0.

Minor change to test case

Sep 15 2020, 6:02 AM · Restricted Project
ebrevnov updated the diff for D87679: [LV] Unroll factor is expected to be > 0.

Addressed comments

Sep 15 2020, 6:00 AM · Restricted Project
ebrevnov added inline comments to D87679: [LV] Unroll factor is expected to be > 0.
Sep 15 2020, 5:58 AM · Restricted Project
ebrevnov added reviewers for D87679: [LV] Unroll factor is expected to be > 0: fhahn, hsaito, Ayal, mkuper.
Sep 15 2020, 3:19 AM · Restricted Project
ebrevnov requested review of D87679: [LV] Unroll factor is expected to be > 0.
Sep 15 2020, 3:16 AM · Restricted Project

Sep 10 2020

ebrevnov added a comment to D79485: [BPI] Improve static heuristics for "cold" paths..

ping

Sep 10 2020, 9:07 PM · Restricted Project