Page MenuHomePhabricator

caojoshua (Joshua Cao)
User

Projects

User does not belong to any projects.

User Details

User Since
Nov 11 2022, 9:48 PM (12 w, 1 d)

Recent Activity

Tue, Jan 31

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)

Tue, Jan 31, 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.

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

Thu, Jan 26

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

Tue, Jan 24

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.

Tue, Jan 24, 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
Tue, Jan 24, 8:17 PM · Restricted Project, Restricted Project
caojoshua closed D142330: [AssumptionCache] caches @llvm.experimental.guard's.
Tue, Jan 24, 8:17 PM · Restricted Project, Restricted Project
caojoshua added a comment to D141823: [SCEV] More precise trip multiples.

ping

Tue, Jan 24, 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
Tue, Jan 24, 12:17 AM · Restricted Project, Restricted Project

Mon, Jan 23

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)
Mon, Jan 23, 1:58 AM · Restricted Project, Restricted Project
caojoshua published D142330: [AssumptionCache] caches @llvm.experimental.guard's for review.
Mon, Jan 23, 12:54 AM · Restricted Project, Restricted Project

Thu, Jan 19

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.

Thu, Jan 19, 9:08 AM · Restricted Project, Restricted Project
caojoshua added a reviewer for D141850: [SCEV] Preserve divisibility and min/max information in applyLoopGuards: mkazantsev.
Thu, Jan 19, 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:

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

Tue, Jan 17

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.

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

Mon, Jan 16

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.

Mon, Jan 16, 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
Mon, Jan 16, 11:05 PM · Restricted Project, Restricted Project
caojoshua added a comment to D141823: [SCEV] More precise trip multiples.

Precommit tests please.

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

Fri, Jan 13

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

Thu, Jan 12

caojoshua committed rGf1705509400f: [LoopReroll] Allow for multiple loop control only induction vars (authored by caojoshua).
[LoopReroll] Allow for multiple loop control only induction vars
Thu, Jan 12, 9:01 PM · Restricted Project, Restricted Project
caojoshua closed D141109: [LoopReroll] Allow for multiple loop control only induction vars.
Thu, Jan 12, 9:01 PM · Restricted Project, Restricted Project
caojoshua added inline comments to D141568: [SCEV] Support SMin/Umin for GetMinTrailingZeros.
Thu, Jan 12, 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
Thu, Jan 12, 8:50 PM · Restricted Project, Restricted Project
caojoshua added inline comments to D141109: [LoopReroll] Allow for multiple loop control only induction vars.
Thu, Jan 12, 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.

Thu, Jan 12, 8:41 AM · Restricted Project, Restricted Project
caojoshua added inline comments to D141568: [SCEV] Support SMin/Umin for GetMinTrailingZeros.
Thu, Jan 12, 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
Thu, Jan 12, 8:31 AM · Restricted Project, Restricted Project
caojoshua closed D141029: [NFC][LoopFlatten][LoopInterchange] Do not explicitly forget subloops.
Thu, Jan 12, 8:31 AM · Restricted Project, Restricted Project

Wed, Jan 11

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

Add a test where trip multiple is 1

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

edit comment in test

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

ping

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

Mon, Jan 9

caojoshua added a reviewer for D141109: [LoopReroll] Allow for multiple loop control only induction vars: kawashima-fj.
Mon, Jan 9, 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()
Mon, Jan 9, 7:36 PM · Restricted Project, Restricted Project
caojoshua closed D141243: [SCEV] Add llvm.experimental.guard conditions to applyLoopGuards().
Mon, Jan 9, 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.

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

Sun, Jan 8

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

Thu, Jan 5

caojoshua published D141109: [LoopReroll] Allow for multiple loop control only induction vars for review.
Thu, Jan 5, 11:00 PM · Restricted Project, Restricted Project

Jan 5 2023

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