Page MenuHomePhabricator
Feed Advanced Search

Today

caojoshua published D147117: [SCEV] When computing trip count, only zext if necessary for review.
Wed, Mar 29, 12:25 AM · Restricted Project, Restricted Project

Feb 25 2023

caojoshua added a comment to D142330: [AssumptionCache] caches @llvm.experimental.guard's.

If this change goes forward, we need to investigate all places where assumes/AssumptionCache is used and see if what is being done for assumes holds for guards as well. In LVI, what was done for assumes did not hold for guards.
Also, in future, when anyone adds assumption cache (under the idea that it handles assumes), we can very easily fall into the problem of having a miscompile with guards. For that reason and given that we are working towards moving away from this implementation, I would suggest we abandon this
change altogether.

Feb 25 2023, 2:12 PM · Restricted Project, Restricted Project
caojoshua added a comment to D141850: [SCEV] Preserve divisibility and min/max information in applyLoopGuards.

Why was this reverted?

Feb 25 2023, 2:03 PM · Restricted Project, Restricted Project

Feb 19 2023

caojoshua committed rGe19d9eea6e36: [SCEV] Add automated test checks for some tests (authored by caojoshua).
[SCEV] Add automated test checks for some tests
Feb 19 2023, 12:00 AM · Restricted Project, Restricted Project

Feb 18 2023

caojoshua abandoned D144343: [ConstantRange][SCEV] print unsigned ranges.
Feb 18 2023, 11:57 PM · Restricted Project, Restricted Project
caojoshua added a comment to D144343: [ConstantRange][SCEV] print unsigned ranges.

I'm okay with this, but just looking at the test diffs, I'm not sure how helpful this really is... I'd consider a range like [0,-3) to be easier to understand than [0,18446744073709551613), even when interpreting it in an unsigned sense.

Feb 18 2023, 11:57 PM · Restricted Project, Restricted Project
caojoshua added reviewers for D144343: [ConstantRange][SCEV] print unsigned ranges: mkazantsev, fhahn, nikic.
Feb 18 2023, 11:06 PM · Restricted Project, Restricted Project
caojoshua requested review of D144343: [ConstantRange][SCEV] print unsigned ranges.
Feb 18 2023, 11:02 PM · Restricted Project, Restricted Project

Feb 16 2023

caojoshua added a comment to D142330: [AssumptionCache] caches @llvm.experimental.guard's.

@caojoshua I wonder, are you using guards for some reason?

Feb 16 2023, 12:04 AM · Restricted Project, Restricted Project

Feb 6 2023

caojoshua added a comment to D142689: [SCEV] Remove applyLoopGuards ExprsToRewrite.

ping

Feb 6 2023, 8:22 PM · Restricted Project, Restricted Project

Jan 31 2023

caojoshua added a comment to D141850: [SCEV] Preserve divisibility and min/max information in applyLoopGuards.

I think the example is correct.
Even before this patch:
TC > 0 is translated to max (TC, 1)
TC < 99 is translated to min (TC, 98)

Jan 31 2023, 10:57 PM · Restricted Project, Restricted Project
caojoshua added a comment to D141823: [SCEV] More precise trip multiples.

I think this needs stronger test coverage. At least I want tests for all operations (either IR tests or unittests in CPP, whatever is easier) exercising corner case scenarios, such as bit width overflow with mul.

Jan 31 2023, 12:15 AM · Restricted Project, Restricted Project

Jan 26 2023

caojoshua added inline comments to D142689: [SCEV] Remove applyLoopGuards ExprsToRewrite.
Jan 26 2023, 10:57 PM · Restricted Project, Restricted Project
caojoshua added reviewers for D142689: [SCEV] Remove applyLoopGuards ExprsToRewrite: fhahn, nikic.
Jan 26 2023, 10:44 PM · Restricted Project, Restricted Project
caojoshua requested review of D142689: [SCEV] Remove applyLoopGuards ExprsToRewrite.
Jan 26 2023, 10:44 PM · Restricted Project, Restricted Project

Jan 24 2023

caojoshua added a comment to D141823: [SCEV] More precise trip multiples.

I wonder if it might make sense to address this first? I'm a bit worried that the only test coverage for this functionality we have right now is very indirect, by the effect the multiple has on ranges. It would be great if we could test this functionality directly based on the trip multiple.

Jan 24 2023, 8:22 PM · Restricted Project, Restricted Project
caojoshua committed rGf9599bbc7a3f: [AssumptionCache] caches @llvm.experimental.guard's (authored by caojoshua).
[AssumptionCache] caches @llvm.experimental.guard's
Jan 24 2023, 8:17 PM · Restricted Project, Restricted Project
caojoshua closed D142330: [AssumptionCache] caches @llvm.experimental.guard's.
Jan 24 2023, 8:17 PM · Restricted Project, Restricted Project
caojoshua added a comment to D141823: [SCEV] More precise trip multiples.

ping

Jan 24 2023, 12:20 AM · Restricted Project, Restricted Project
caojoshua updated the diff for D142330: [AssumptionCache] caches @llvm.experimental.guard's.
  • added a CondGuardInst that consists of assumes and guards
  • added to AC's basic.ll test
Jan 24 2023, 12:17 AM · Restricted Project, Restricted Project

Jan 23 2023

caojoshua added a comment to D141850: [SCEV] Preserve divisibility and min/max information in applyLoopGuards.
After this patch, depending on the assume processing order applyLoopGuards could create the following SCEV:
max(min((8 * (TC / 8)) , 96), 8)
Jan 23 2023, 1:58 AM · Restricted Project, Restricted Project
caojoshua published D142330: [AssumptionCache] caches @llvm.experimental.guard's for review.
Jan 23 2023, 12:54 AM · Restricted Project, Restricted Project

Jan 19 2023

caojoshua added a comment to D141850: [SCEV] Preserve divisibility and min/max information in applyLoopGuards.

The improved trip multiples from the test results look good. Ordering in applyLoopGuards is an issue. However, I think we can simplify this down a bit. What if we always applied min/max first, before we apply divisibility guards? For example, given:

__builtin_assume(TC % 8 == 0);
__builtin_assume(TC > 0);
__builtin_assume(TC < 100);
  1. apply max: umax(1, TC)
  2. apply min: umin(100, umax(1, TC))
  3. apply divisibility info: 8 * (umin(100, umax(1, TC))) / 8

This makes divisibility info obvious. And traversing the SCEV, we can still see TC > 0 and TC < 100. I believe that if we always apply max/min first, we will never lose this info. This approach seems much simpler and easier to understand.

FYI. I haven't been around that long, and this change is non-trivial enough where I prefer a longstanding developer to give the final approval. I will still be around to give my thoughts.

Thanks for the reply.
This works in this example, but what would happen if we had only these assumes:

__builtin_assume(TC % 8 == 0);
__builtin_assume(TC > 0);

In that case, we would have created the following SCEV:

8 * (umax(1, TC) / 8)

since umax(1, TC) may still be between [1,7], when we divide it by 8, and multiply by 8, we get 0. So this doesn't preserve the fact that TC > 0.
In order to do that we must align up 1 to 8, and then umax(8, TC) / 8 is always > 0.

Jan 19 2023, 9:08 AM · Restricted Project, Restricted Project
caojoshua added a reviewer for D141850: [SCEV] Preserve divisibility and min/max information in applyLoopGuards: mkazantsev.
Jan 19 2023, 12:32 AM · Restricted Project, Restricted Project
caojoshua added a comment to D141850: [SCEV] Preserve divisibility and min/max information in applyLoopGuards.

The improved trip multiples from the test results look good. Ordering in applyLoopGuards is an issue. However, I think we can simplify this down a bit. What if we always applied min/max first, before we apply divisibility guards? For example, given:

Jan 19 2023, 12:30 AM · Restricted Project, Restricted Project

Jan 17 2023

caojoshua added a comment to D141850: [SCEV] Preserve divisibility and min/max information in applyLoopGuards.

What is the relation to https://reviews.llvm.org/D128701? Seems maybe you should close the other one.

Jan 17 2023, 12:45 AM · Restricted Project, Restricted Project

Jan 16 2023

caojoshua added a comment to D141823: [SCEV] More precise trip multiples.

Precommit tests please.

What is precommit test? I've been running llvm-lit llvm/test

Commit the new tests with baseline checks (without your patch), and then rebase on top, so it only shows diffs.

Jan 16 2023, 11:12 PM · Restricted Project, Restricted Project
caojoshua updated the diff for D141823: [SCEV] More precise trip multiples.
  • Fix typos
  • Don't assume multiples hold through truncation, unless they are a power of 2
  • only show diffs for updated test outputs
Jan 16 2023, 11:05 PM · Restricted Project, Restricted Project
caojoshua added a comment to D141823: [SCEV] More precise trip multiples.

Precommit tests please.

Jan 16 2023, 8:58 AM · Restricted Project, Restricted Project
caojoshua published D141823: [SCEV] More precise trip multiples for review.
Jan 16 2023, 1:48 AM · Restricted Project, Restricted Project

Jan 13 2023

caojoshua committed rG2f9f11180fde: [SCEV] Support all Min/Max SCEVs for GetMinTrailingZeros (authored by caojoshua).
[SCEV] Support all Min/Max SCEVs for GetMinTrailingZeros
Jan 13 2023, 2:32 AM · Restricted Project, Restricted Project
caojoshua closed D141568: [SCEV] Support SMin/Umin for GetMinTrailingZeros.
Jan 13 2023, 2:32 AM · Restricted Project, Restricted Project

Jan 12 2023

caojoshua committed rGf1705509400f: [LoopReroll] Allow for multiple loop control only induction vars (authored by caojoshua).
[LoopReroll] Allow for multiple loop control only induction vars
Jan 12 2023, 9:01 PM · Restricted Project, Restricted Project
caojoshua closed D141109: [LoopReroll] Allow for multiple loop control only induction vars.
Jan 12 2023, 9:01 PM · Restricted Project, Restricted Project
caojoshua added inline comments to D141568: [SCEV] Support SMin/Umin for GetMinTrailingZeros.
Jan 12 2023, 8:51 PM · Restricted Project, Restricted Project
caojoshua updated the diff for D141568: [SCEV] Support SMin/Umin for GetMinTrailingZeros.
  • support UMinSequential. Add a test (see note below)
  • single isa<SCEVMinMaxExpr>(S) instead of checking each subtype
  • fix code style based on comments
Jan 12 2023, 8:50 PM · Restricted Project, Restricted Project
caojoshua added inline comments to D141109: [LoopReroll] Allow for multiple loop control only induction vars.
Jan 12 2023, 8:42 AM · Restricted Project, Restricted Project
caojoshua updated the diff for D141109: [LoopReroll] Allow for multiple loop control only induction vars.

Thanks for review. Implemented all feedback.

Jan 12 2023, 8:41 AM · Restricted Project, Restricted Project
caojoshua added inline comments to D141568: [SCEV] Support SMin/Umin for GetMinTrailingZeros.
Jan 12 2023, 8:32 AM · Restricted Project, Restricted Project
caojoshua committed rGb2b4d95827b7: [NFC][LoopFlatten][LoopInterchange] Do not explicitly forget subloops (authored by caojoshua).
[NFC][LoopFlatten][LoopInterchange] Do not explicitly forget subloops
Jan 12 2023, 8:31 AM · Restricted Project, Restricted Project
caojoshua closed D141029: [NFC][LoopFlatten][LoopInterchange] Do not explicitly forget subloops.
Jan 12 2023, 8:31 AM · Restricted Project, Restricted Project

Jan 11 2023

caojoshua updated the diff for D141568: [SCEV] Support SMin/Umin for GetMinTrailingZeros.

Add a test where trip multiple is 1

Jan 11 2023, 11:40 PM · Restricted Project, Restricted Project
caojoshua updated the diff for D141568: [SCEV] Support SMin/Umin for GetMinTrailingZeros.

edit comment in test

Jan 11 2023, 11:36 PM · Restricted Project, Restricted Project
caojoshua updated the diff for D141568: [SCEV] Support SMin/Umin for GetMinTrailingZeros.
Jan 11 2023, 11:32 PM · Restricted Project, Restricted Project
caojoshua added reviewers for D141568: [SCEV] Support SMin/Umin for GetMinTrailingZeros: reames, nikic.
Jan 11 2023, 11:26 PM · Restricted Project, Restricted Project
caojoshua requested review of D141568: [SCEV] Support SMin/Umin for GetMinTrailingZeros.
Jan 11 2023, 11:25 PM · Restricted Project, Restricted Project
caojoshua added a comment to D141029: [NFC][LoopFlatten][LoopInterchange] Do not explicitly forget subloops.

ping

Jan 11 2023, 7:55 PM · Restricted Project, Restricted Project

Jan 9 2023

caojoshua added a reviewer for D141109: [LoopReroll] Allow for multiple loop control only induction vars: kawashima-fj.
Jan 9 2023, 8:27 PM · Restricted Project, Restricted Project
caojoshua committed rG8d92a8226eb7: [SCEV] Add llvm.experimental.guard conditions to applyLoopGuards() (authored by caojoshua).
[SCEV] Add llvm.experimental.guard conditions to applyLoopGuards()
Jan 9 2023, 7:36 PM · Restricted Project, Restricted Project
caojoshua closed D141243: [SCEV] Add llvm.experimental.guard conditions to applyLoopGuards().
Jan 9 2023, 7:35 PM · Restricted Project, Restricted Project
caojoshua added a comment to D141243: [SCEV] Add llvm.experimental.guard conditions to applyLoopGuards().

We should add support for guard intrinsics to AssumptionCache instead. For all practical purposes, they need the same handling, and it makes little sense that we keep implementing separate handling for assumes and guards each time.

Jan 9 2023, 9:31 AM · Restricted Project, Restricted Project

Jan 8 2023

caojoshua published D141243: [SCEV] Add llvm.experimental.guard conditions to applyLoopGuards() for review.
Jan 8 2023, 5:34 PM · Restricted Project, Restricted Project

Jan 5 2023

caojoshua published D141109: [LoopReroll] Allow for multiple loop control only induction vars for review.
Jan 5 2023, 11:00 PM · Restricted Project, Restricted Project
caojoshua committed rG629d880dc527: [LoopUnrollAndJam] Visit phi operand dependencies in post-order (authored by caojoshua).
[LoopUnrollAndJam] Visit phi operand dependencies in post-order
Jan 5 2023, 12:12 AM · Restricted Project, Restricted Project
caojoshua closed D140255: [LoopUnrollAndJam] Visit phi operand dependencies in post-order.
Jan 5 2023, 12:11 AM · Restricted Project, Restricted Project

Jan 4 2023

caojoshua published D141029: [NFC][LoopFlatten][LoopInterchange] Do not explicitly forget subloops for review.
Jan 4 2023, 9:03 PM · Restricted Project, Restricted Project
caojoshua committed rG50be2859443a: [LoopUnrollAndJam] Forget scalar evolution dispositions. Do no explicitly… (authored by caojoshua).
[LoopUnrollAndJam] Forget scalar evolution dispositions. Do no explicitly…
Jan 4 2023, 7:56 PM · Restricted Project, Restricted Project
caojoshua closed D140953: [LoopUnrollAndJam] Forget scalar evolution dispositions. Do no explicitly forget subloop..
Jan 4 2023, 7:56 PM · Restricted Project, Restricted Project
caojoshua added a comment to D140953: [LoopUnrollAndJam] Forget scalar evolution dispositions. Do no explicitly forget subloop..

Added suggested note that print<scalar-evolution> is needed to populate scev caches. I don't have commit access right now. I sent a request today, but can I get help merging this for now?

Jan 4 2023, 4:53 PM · Restricted Project, Restricted Project
caojoshua updated the diff for D140953: [LoopUnrollAndJam] Forget scalar evolution dispositions. Do no explicitly forget subloop..

Added note that print<scalar-evolution> is used to populate scev caches

Jan 4 2023, 4:51 PM · Restricted Project, Restricted Project
caojoshua added inline comments to D140255: [LoopUnrollAndJam] Visit phi operand dependencies in post-order.
Jan 4 2023, 4:47 PM · Restricted Project, Restricted Project
caojoshua updated the diff for D140255: [LoopUnrollAndJam] Visit phi operand dependencies in post-order.
  • explicit type of ProcessInstr, do not pass it to itself as parameter
  • if I is in AftBlocks, we don't need to check its parent is in LocBB
  • remove unnecessary run from test
Jan 4 2023, 4:46 PM · Restricted Project, Restricted Project
caojoshua updated the diff for D140953: [LoopUnrollAndJam] Forget scalar evolution dispositions. Do no explicitly forget subloop..

Add -verify-scev to test

Jan 4 2023, 12:23 AM · Restricted Project, Restricted Project

Jan 3 2023

caojoshua published D140953: [LoopUnrollAndJam] Forget scalar evolution dispositions. Do no explicitly forget subloop. for review.
Jan 3 2023, 11:04 PM · Restricted Project, Restricted Project
caojoshua added a comment to D140255: [LoopUnrollAndJam] Visit phi operand dependencies in post-order.

ping

Jan 3 2023, 7:21 PM · Restricted Project, Restricted Project

Dec 16 2022

caojoshua published D140255: [LoopUnrollAndJam] Visit phi operand dependencies in post-order for review.
Dec 16 2022, 5:56 PM · Restricted Project, Restricted Project

Dec 12 2022

caojoshua added a comment to D139812: [LoopFusion] sink second loop PHIs.

Thanks for the review. I am not a committer. Can I get help merging this? I have the commit in https://github.com/caojoshua/llvm-project/commit/8c5290e665a5e0c9276d6dcc0a1a56e3e23da27c

Dec 12 2022, 11:28 PM · Restricted Project, Restricted Project
caojoshua published D139812: [LoopFusion] sink second loop PHIs for review.
Dec 12 2022, 12:11 AM · Restricted Project, Restricted Project

Dec 10 2022

caojoshua added a comment to D138360: [CVP] Eliminate urem when LHS < RHS.

Can I get help merging this? I'm not a committer. I have the patch in https://github.com/caojoshua/llvm-project/commit/cac29ca43207f316e2b0904bee45d778d903a76e

Dec 10 2022, 10:53 AM · Restricted Project, Restricted Project

Dec 9 2022

caojoshua updated the diff for D138360: [CVP] Eliminate urem when LHS < RHS.

update test with update_test_checks.py

Dec 9 2022, 10:28 PM · Restricted Project, Restricted Project
caojoshua updated the diff for D138360: [CVP] Eliminate urem when LHS < RHS.

Change redundant ifs into asserts. Change constant range check to use CR1.icmp(icmp_ult, CR2).

Dec 9 2022, 1:22 AM · Restricted Project, Restricted Project

Dec 7 2022

caojoshua added a comment to D139109: [LoopUnswitch] Perform loop unswitching on select instructions.

It looks like this tries to address the same issue as D138526. Might be goo to sync up with @caojoshua

Dec 7 2022, 10:56 PM · Restricted Project, Restricted Project

Dec 1 2022

caojoshua added a comment to D138526: [SimpleLoopUnswitch] unswitch select instructions.

This seems to try to unswitch every select, but https://github.com/llvm/llvm-project/issues/58122 would only require unswitching conditions that are fed by selects with (some) constant values. Would it be possible to just unswitch such branches, rather than all selects?

Dec 1 2022, 6:32 AM · Restricted Project, Restricted Project

Nov 30 2022

caojoshua added a reviewer for D138360: [CVP] Eliminate urem when LHS < RHS: nikic.
Nov 30 2022, 6:53 PM · Restricted Project, Restricted Project
caojoshua added a comment to D138360: [CVP] Eliminate urem when LHS < RHS.

ping

Nov 30 2022, 6:52 PM · Restricted Project, Restricted Project
caojoshua added a reviewer for D138526: [SimpleLoopUnswitch] unswitch select instructions: kazu.
Nov 30 2022, 6:51 PM · Restricted Project, Restricted Project
caojoshua added a comment to D138526: [SimpleLoopUnswitch] unswitch select instructions.

ping

Nov 30 2022, 6:50 PM · Restricted Project, Restricted Project

Nov 22 2022

caojoshua published D138526: [SimpleLoopUnswitch] unswitch select instructions for review.
Nov 22 2022, 3:14 PM · Restricted Project, Restricted Project

Nov 19 2022

caojoshua published D138360: [CVP] Eliminate urem when LHS < RHS for review.
Nov 19 2022, 12:12 PM · Restricted Project, Restricted Project

Nov 13 2022

caojoshua added a comment to D137893: [AsmWriter] Do not write a comma when varargs is the only argument.

I have my git commit in in my github fork

Nov 13 2022, 7:29 PM · Restricted Project, Restricted Project

Nov 12 2022

caojoshua added a comment to D137893: [AsmWriter] Do not write a comma when varargs is the only argument.

LGTM, with small nit:

There is a typo in the commit description

I did not write a dedicated this for this change

should be

I did not write a dedicated test for this change

Please fix before merging

Nov 12 2022, 5:44 PM · Restricted Project, Restricted Project
caojoshua updated the summary of D137893: [AsmWriter] Do not write a comma when varargs is the only argument.
Nov 12 2022, 5:29 PM · Restricted Project, Restricted Project
caojoshua updated the summary of D137893: [AsmWriter] Do not write a comma when varargs is the only argument.
Nov 12 2022, 8:37 AM · Restricted Project, Restricted Project
caojoshua published D137893: [AsmWriter] Do not write a comma when varargs is the only argument for review.
Nov 12 2022, 8:17 AM · Restricted Project, Restricted Project