Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

chfast (Paweł Bylica)
User

Projects

User does not belong to any projects.

User Details

User Since
May 16 2014, 8:34 AM (488 w, 2 d)

Recent Activity

Aug 3 2023

chfast added a comment to D154522: [DAG] Improve combineCarryDiamond to accept (uaddo_carry X, 0, Carry).

Are you able to add any tests supporting this?

Aug 3 2023, 7:50 AM · Restricted Project, Restricted Project

Jul 22 2023

chfast added a comment to D154533: [DAG] Improve carry reconstruction in combineCarryDiamond..

In this case, we replace a complex web of instructions by just one add. Reconstructing a carry is worth it. The test cases that were changed bellow are good exemple of that, the carry is passed as an argument to the functions, so it is not possible to know if these are "real" carries or not, and it is nevertheless worth doing the transform.

I was thinking about cases like feeding uaddo by a setcc, but that does not seem to pay off. E.g.:

declare { i64, i1 } @llvm.usub.with.overflow.i64(i64, i64)

define { i64, i1 } @subcarry_fake_carry(i64 %a, i64 %b, i32 %x, i32 %y) {
    %t1 = call { i64, i1 } @llvm.usub.with.overflow.i64(i64 %a, i64 %b)
    %partial = extractvalue { i64, i1 } %t1, 0
    %k1 = extractvalue { i64, i1 } %t1, 1

    %carryin = icmp eq i32 %x, %y
    %zcarryin = zext i1 %carryin to i64
    %s = call { i64, i1 } @llvm.usub.with.overflow.i64(i64 %partial, i64 %zcarryin)
    %k2 = extractvalue { i64, i1 } %s, 1

    %carryout = or i1 %k1, %k2

    %ret = insertvalue { i64, i1 } %s, i1 %carryout, 1
    ret { i64, i1 } %ret
}
Jul 22 2023, 11:00 AM · Restricted Project, Restricted Project

Jul 19 2023

chfast committed rG966318005abe: [InstCombine] Preserve metadata when combining select+binop (authored by chfast).
[InstCombine] Preserve metadata when combining select+binop
Jul 19 2023, 6:27 AM · Restricted Project, Restricted Project
chfast committed rG7769c1e62339: [InstCombine][NFC] Add tests for preserving metadata (authored by chfast).
[InstCombine][NFC] Add tests for preserving metadata
Jul 19 2023, 6:27 AM · Restricted Project, Restricted Project
chfast closed D155461: [InstCombine] Preserve metadata when combining select+binop.
Jul 19 2023, 6:26 AM · Restricted Project, Restricted Project
chfast closed D155594: [InstCombine][NFC] Add tests for preserving metadata.
Jul 19 2023, 6:26 AM · Restricted Project, Restricted Project
chfast updated the diff for D155461: [InstCombine] Preserve metadata when combining select+binop.

Removed TODO comments from tests.

Jul 19 2023, 4:14 AM · Restricted Project, Restricted Project
chfast added inline comments to D155594: [InstCombine][NFC] Add tests for preserving metadata.
Jul 19 2023, 4:11 AM · Restricted Project, Restricted Project
chfast updated the diff for D155594: [InstCombine][NFC] Add tests for preserving metadata.

Update tests with --check-globals

Jul 19 2023, 3:43 AM · Restricted Project, Restricted Project
chfast abandoned D14446: Fallback to getpwuid() in path::home_directory() on Unix..
Jul 19 2023, 3:17 AM · Restricted Project
chfast retitled D155461: [InstCombine] Preserve metadata when combining select+binop from [InstCombine] Keep !unpredictable when combining select+add to [InstCombine] Preserve metadata when combining select+binop.
Jul 19 2023, 3:05 AM · Restricted Project, Restricted Project
chfast added inline comments to D155461: [InstCombine] Preserve metadata when combining select+binop.
Jul 19 2023, 3:05 AM · Restricted Project, Restricted Project
chfast updated the diff for D155461: [InstCombine] Preserve metadata when combining select+binop.

Rebased on new tests cases.

Jul 19 2023, 3:02 AM · Restricted Project, Restricted Project
chfast retitled D155594: [InstCombine][NFC] Add tests for preserving metadata from [InstCombine][NFC] Add tests for preserving !unreachable to [InstCombine][NFC] Add tests for preserving metadata.
Jul 19 2023, 3:01 AM · Restricted Project, Restricted Project
chfast added inline comments to D155594: [InstCombine][NFC] Add tests for preserving metadata.
Jul 19 2023, 2:58 AM · Restricted Project, Restricted Project
chfast updated the diff for D155594: [InstCombine][NFC] Add tests for preserving metadata.

Focus on select+binop, add more test cases.

Jul 19 2023, 2:57 AM · Restricted Project, Restricted Project

Jul 18 2023

chfast committed rG73245359847d: [clang][NFC] Fix typos in sema builtins test (authored by chfast).
[clang][NFC] Fix typos in sema builtins test
Jul 18 2023, 6:41 AM · Restricted Project, Restricted Project
chfast added inline comments to D155594: [InstCombine][NFC] Add tests for preserving metadata.
Jul 18 2023, 6:31 AM · Restricted Project, Restricted Project
chfast requested review of D155594: [InstCombine][NFC] Add tests for preserving metadata.
Jul 18 2023, 6:22 AM · Restricted Project, Restricted Project
chfast added inline comments to D139408: [InstCombine] Fold logic-and/logic-or by distributive laws.
Jul 18 2023, 2:58 AM · Restricted Project, Restricted Project
chfast added inline comments to D155461: [InstCombine] Preserve metadata when combining select+binop.
Jul 18 2023, 12:48 AM · Restricted Project, Restricted Project

Jul 17 2023

chfast added inline comments to D155461: [InstCombine] Preserve metadata when combining select+binop.
Jul 17 2023, 7:11 AM · Restricted Project, Restricted Project
chfast requested review of D155461: [InstCombine] Preserve metadata when combining select+binop.
Jul 17 2023, 7:08 AM · Restricted Project, Restricted Project

Jul 14 2023

chfast added a comment to D153453: [MemCpyOpt] implement single BB stack-move optimization which unify the static unescaped allocas .

Could you also add the test case from https://reviews.llvm.org/D155207 ? It was reproducing the issue I had when compiling firefox.

Jul 14 2023, 2:48 AM · Restricted Project, Restricted Project

Jun 14 2023

chfast added a comment to D127115: [DAGCombine] Make sure combined nodes are added back to the worklist in topological order..

Thanks for working on this and good luck.

Jun 14 2023, 9:46 AM · Restricted Project, Restricted Project

Feb 8 2023

chfast added inline comments to D127115: [DAGCombine] Make sure combined nodes are added back to the worklist in topological order..
Feb 8 2023, 12:19 AM · Restricted Project, Restricted Project

Jan 13 2023

chfast abandoned D56214: AggressiveInstCombine: Fold full mul i64 x i64 -> i128.
Jan 13 2023, 12:59 AM · Restricted Project, Restricted Project
chfast abandoned D118037: [DAGCombine] Consider SETULT as carry flag.
Jan 13 2023, 12:59 AM · Restricted Project, Restricted Project

Nov 28 2022

chfast added a comment to D138814: [InstCombine] Combine lshr of add -> (a + b < a).

What do you think about producing the sequence with 'not' + 'icmp' instead of the uadd + extract?

The point about using uadd.with.overflow is that it also gives you the truncated 32 bit result of the add.

If we're not using that value (as shown in the first two tests), then do we still we want to canonicalize to an overflow intrinsic? That implies that we also need to transform the "not+icmp" pattern into "uadd+extract" to be consistent.

Nov 28 2022, 9:25 AM · Restricted Project, Restricted Project

Nov 27 2022

chfast updated the diff for D127115: [DAGCombine] Make sure combined nodes are added back to the worklist in topological order..

Rebased.

Nov 27 2022, 7:02 AM · Restricted Project, Restricted Project

Nov 24 2022

chfast added inline comments to D127115: [DAGCombine] Make sure combined nodes are added back to the worklist in topological order..
Nov 24 2022, 2:14 PM · Restricted Project, Restricted Project

Nov 2 2022

chfast abandoned D56277: AggressiveInstCombine: Add tests for full multiplication pattern match.
Nov 2 2022, 5:17 AM · Restricted Project, Restricted Project
chfast added a comment to D56214: AggressiveInstCombine: Fold full mul i64 x i64 -> i128.

@chfast What do you want to do with this patch now that D136015 landed?

Nov 2 2022, 1:40 AM · Restricted Project, Restricted Project

Oct 25 2022

chfast accepted D136661: [InstCombine] Fold series of instructions into mull for more types.

LGTM, but I'd wait for one more review.

Oct 25 2022, 2:18 AM · Restricted Project, Restricted Project
chfast requested changes to D136661: [InstCombine] Fold series of instructions into mull for more types.
Oct 25 2022, 12:05 AM · Restricted Project, Restricted Project

Oct 24 2022

chfast added inline comments to D136015: [InstCombine] Fold series of instructions into mull.
Oct 24 2022, 11:56 PM · Restricted Project, Restricted Project
chfast added inline comments to D136015: [InstCombine] Fold series of instructions into mull.
Oct 24 2022, 7:15 AM · Restricted Project, Restricted Project

Oct 23 2022

chfast added inline comments to rG119c34e7f9c6: [InstCombine][test] Add tests for mul combinations.
Oct 23 2022, 3:47 AM · Restricted Project, Restricted Project

Oct 22 2022

chfast added a comment to D136015: [InstCombine] Fold series of instructions into mull.

In https://reviews.llvm.org/D56214 similar pattern match was applied in AggressiveInstCombine.

Do you want me to submit test cases from there?

Yes please @chfast, if you think we can just use this patch then maybe just move them (and tweak for -instcombine).

Oct 22 2022, 7:28 AM · Restricted Project, Restricted Project
chfast committed rG119c34e7f9c6: [InstCombine][test] Add tests for mul combinations (authored by chfast).
[InstCombine][test] Add tests for mul combinations
Oct 22 2022, 7:26 AM · Restricted Project, Restricted Project

Oct 21 2022

chfast added a comment to D136015: [InstCombine] Fold series of instructions into mull.

In https://reviews.llvm.org/D56214 similar pattern match was applied in AggressiveInstCombine.

Oct 21 2022, 10:16 AM · Restricted Project, Restricted Project

Oct 7 2022

chfast committed rG62ea6c5be785: [DAGCombine] Deduplicate addcarry node using commutativity. (authored by Amaury Séchet <deadalnix@gmail.com>).
[DAGCombine] Deduplicate addcarry node using commutativity.
Oct 7 2022, 3:56 PM · Restricted Project, Restricted Project
chfast closed D57317: [DAGCombine] Deduplicate addcarry node using commutativity..
Oct 7 2022, 3:55 PM · Restricted Project, Restricted Project

Oct 2 2022

chfast added a comment to D57317: [DAGCombine] Deduplicate addcarry node using commutativity..

Is it fine I commit this?

Oct 2 2022, 12:17 AM · Restricted Project, Restricted Project

Oct 1 2022

chfast accepted D57317: [DAGCombine] Deduplicate addcarry node using commutativity..
Oct 1 2022, 10:38 AM · Restricted Project, Restricted Project
chfast updated the diff for D57317: [DAGCombine] Deduplicate addcarry node using commutativity..

Rebased.

Oct 1 2022, 10:34 AM · Restricted Project, Restricted Project
chfast added a comment to D57317: [DAGCombine] Deduplicate addcarry node using commutativity..

I added tests for this change.
https://reviews.llvm.org/rGe399c5877801
https://github.com/llvm/llvm-project/commit/e399c58778017388a818cabd1b13fcb88b79a432

Oct 1 2022, 8:03 AM · Restricted Project, Restricted Project
chfast committed rGe399c5877801: [DAGCombine] Add tests for D57317 (authored by chfast).
[DAGCombine] Add tests for D57317
Oct 1 2022, 8:00 AM · Restricted Project, Restricted Project
chfast added a comment to D127115: [DAGCombine] Make sure combined nodes are added back to the worklist in topological order..

@deadalnix - reverse ping

Oct 1 2022, 2:48 AM · Restricted Project, Restricted Project

Aug 23 2022

chfast committed rG72faccc3f055: [DAGCombine] Add more tests for cmp to sbb combination; NFC (authored by chfast).
[DAGCombine] Add more tests for cmp to sbb combination; NFC
Aug 23 2022, 11:28 PM · Restricted Project, Restricted Project
chfast closed D132463: [test] Add more tests for cmp to sbb combination.
Aug 23 2022, 11:28 PM · Restricted Project, Restricted Project
chfast requested review of D132463: [test] Add more tests for cmp to sbb combination.
Aug 23 2022, 4:44 AM · Restricted Project, Restricted Project
chfast added inline comments to D127115: [DAGCombine] Make sure combined nodes are added back to the worklist in topological order..
Aug 23 2022, 3:12 AM · Restricted Project, Restricted Project
chfast added inline comments to D57367: [DAGCombine] Do several rounds of combine for nodes using SimplifyDemandedBits..
Aug 23 2022, 12:33 AM · Restricted Project, Restricted Project
Herald added a project to D33587: [DAGCombine] Do several rounds of combine.: Restricted Project.
Aug 23 2022, 12:09 AM · Restricted Project, Restricted Project
chfast added a comment to D118037: [DAGCombine] Consider SETULT as carry flag.

Please can you rebase to see where we currently are? Also D127115 affects these tests - so maybe see whether this SETULT change is still needed after that patch or whether something else can further improve the codegen?

For what it is worth, when the dag is processed in fully topological order, and you add in D57317 , then you get optimal codegen for these tests.

Aug 23 2022, 12:08 AM · Restricted Project, Restricted Project

Aug 18 2022

chfast updated the diff for D118037: [DAGCombine] Consider SETULT as carry flag.

Rebased.

Aug 18 2022, 7:18 AM · Restricted Project, Restricted Project
chfast added a comment to D118037: [DAGCombine] Consider SETULT as carry flag.

Should I try to push this by adding a TTI flag like "CmpULTsetsCarryFlag"?

Aug 18 2022, 3:45 AM · Restricted Project, Restricted Project
chfast added a reviewer for D118037: [DAGCombine] Consider SETULT as carry flag: spatel.
Aug 18 2022, 3:44 AM · Restricted Project, Restricted Project

May 16 2022

chfast accepted D125642: [X86] Attempt to fold EFLAGS into X86ISD::ADD/SUB ops.

Looks very nice, thanks.

May 16 2022, 12:32 AM · Restricted Project, Restricted Project

Mar 14 2022

chfast added a comment to D56214: AggressiveInstCombine: Fold full mul i64 x i64 -> i128.

@chfast What happened to this patch? I was looking at https://llvm.org/PR36243 and wondering if it'd be worth AggressiveInstCombine/InstCombine doing something similar for adds (in that case a 3 chain add i32 to add i96).

Mar 14 2022, 11:40 AM · Restricted Project, Restricted Project
chfast added a comment to D118037: [DAGCombine] Consider SETULT as carry flag.

On the high level note, using builtin_subc() or builtin_sub_with_overflow() is good enough workaround.

Mar 14 2022, 11:27 AM · Restricted Project, Restricted Project
chfast added a comment to D118037: [DAGCombine] Consider SETULT as carry flag.

@chfast reverse-ping - any luck with working out how best to deal with add_U320_without_i128_add?

Mar 14 2022, 11:24 AM · Restricted Project, Restricted Project

Feb 25 2022

chfast committed rGeb1ff70fc5fc: [X86] Combine ADC(ADD(X,Y),0,Carry) -> ADC(X,Y,Carry) (authored by chfast).
[X86] Combine ADC(ADD(X,Y),0,Carry) -> ADC(X,Y,Carry)
Feb 25 2022, 5:32 AM
chfast closed D120435: [X86] Combine ADC(ADD(X,Y),0,Carry) -> ADC(X,Y,Carry).
Feb 25 2022, 5:31 AM · Restricted Project, Restricted Project

Feb 23 2022

chfast added inline comments to D120435: [X86] Combine ADC(ADD(X,Y),0,Carry) -> ADC(X,Y,Carry).
Feb 23 2022, 2:05 PM · Restricted Project, Restricted Project
chfast added inline comments to D118037: [DAGCombine] Consider SETULT as carry flag.
Feb 23 2022, 2:03 PM · Restricted Project, Restricted Project
chfast requested review of D120435: [X86] Combine ADC(ADD(X,Y),0,Carry) -> ADC(X,Y,Carry).
Feb 23 2022, 2:02 PM · Restricted Project, Restricted Project
chfast committed rGafdaa86b771f: [DAGCombine] Extend combineCarryDiamond() (authored by chfast).
[DAGCombine] Extend combineCarryDiamond()
Feb 23 2022, 12:39 PM
chfast closed D118362: [DAGCombine] Extend combineCarryDiamond().
Feb 23 2022, 12:38 PM · Restricted Project
chfast abandoned D22565: YAMLParser: report errors according to provided position.
Feb 23 2022, 10:28 AM

Feb 21 2022

chfast retitled D118362: [DAGCombine] Extend combineCarryDiamond() from [DAGCombine] Extend and refactor combineCarryDiamond() to [DAGCombine] Extend combineCarryDiamond().
Feb 21 2022, 12:46 PM · Restricted Project
chfast updated the diff for D118362: [DAGCombine] Extend combineCarryDiamond().

Rebased.

Feb 21 2022, 12:45 PM · Restricted Project
chfast committed rGdf0c16ce0062: [NFC][DAGCombine] Use isOperandOf() in combineCarryDiamond (authored by chfast).
[NFC][DAGCombine] Use isOperandOf() in combineCarryDiamond
Feb 21 2022, 12:42 PM
chfast added a comment to D118037: [DAGCombine] Consider SETULT as carry flag.

This was intermediate change to solve https://github.com/llvm/llvm-project/issues/53432. There I want to merge sub + cmp into single sbb. Any suggestions how to solve it differently?

Feb 21 2022, 11:39 AM · Restricted Project, Restricted Project

Feb 16 2022

chfast added a comment to D118037: [DAGCombine] Consider SETULT as carry flag.

Maybe perform this inside X86ISelLowering?

Feb 16 2022, 1:18 PM · Restricted Project, Restricted Project

Jan 28 2022

chfast added inline comments to D118362: [DAGCombine] Extend combineCarryDiamond().
Jan 28 2022, 1:03 PM · Restricted Project

Jan 27 2022

chfast requested review of D118362: [DAGCombine] Extend combineCarryDiamond().
Jan 27 2022, 6:35 AM · Restricted Project

Jan 26 2022

chfast abandoned D118035: [test][DAGCombine] Add tests for combining carry diamond. NFC.
Jan 26 2022, 3:33 PM · Restricted Project
chfast committed rGbdb7837481c2: [test][DAGCombine] Add more tests for carry diamond. NFC (authored by chfast).
[test][DAGCombine] Add more tests for carry diamond. NFC
Jan 26 2022, 3:27 PM
chfast added a comment to D118037: [DAGCombine] Consider SETULT as carry flag.

What I try to do in the end is to fix https://github.com/llvm/llvm-project/issues/53432. Maybe this particular change is not good direction, but on the other hand it also helps with the test add_U320_without_i128_add already in repo.

Jan 26 2022, 3:21 PM · Restricted Project, Restricted Project
chfast added a reviewer for D118037: [DAGCombine] Consider SETULT as carry flag: lebedev.ri.

BTW - how come we still have the ISD::ADDE/SUBE nodes? I thought we were intending to get rid of them as the glue nodes made them difficult to work with.

Jan 26 2022, 7:19 AM · Restricted Project, Restricted Project
chfast added a comment to D118037: [DAGCombine] Consider SETULT as carry flag.

Is ISD::SETULT documented as affecting carry flag?

Jan 26 2022, 5:16 AM · Restricted Project, Restricted Project
chfast added a reviewer for D118035: [test][DAGCombine] Add tests for combining carry diamond. NFC: xbolva00.
Jan 26 2022, 3:28 AM · Restricted Project

Jan 25 2022

chfast updated the diff for D118037: [DAGCombine] Consider SETULT as carry flag.

Use switch. Rebased.

Jan 25 2022, 2:51 PM · Restricted Project, Restricted Project
chfast committed rG8f5b1d9e1462: [test][DAGCombine] Add tests for cmp+add -> addcarry (authored by chfast).
[test][DAGCombine] Add tests for cmp+add -> addcarry
Jan 25 2022, 1:17 PM
chfast updated the summary of D118037: [DAGCombine] Consider SETULT as carry flag.
Jan 25 2022, 10:30 AM · Restricted Project, Restricted Project
chfast updated the diff for D118037: [DAGCombine] Consider SETULT as carry flag.

Address review comments.

Jan 25 2022, 10:29 AM · Restricted Project, Restricted Project
chfast added reviewers for D118035: [test][DAGCombine] Add tests for combining carry diamond. NFC: spatel, lebedev.ri.
Jan 25 2022, 9:31 AM · Restricted Project
chfast added a comment to D118037: [DAGCombine] Consider SETULT as carry flag.

What do you think about this idea in general? Can we assume or check if SETULT actually affects CL flag on given target?

Jan 25 2022, 9:27 AM · Restricted Project, Restricted Project

Jan 24 2022

chfast added a reviewer for D118037: [DAGCombine] Consider SETULT as carry flag: RKSimon.
Jan 24 2022, 12:04 PM · Restricted Project, Restricted Project
chfast committed rG9d32847b3315: [DAGCombine] Remove unused param in combineCarryDiamond(). NFC (authored by chfast).
[DAGCombine] Remove unused param in combineCarryDiamond(). NFC
Jan 24 2022, 11:57 AM
chfast requested review of D118037: [DAGCombine] Consider SETULT as carry flag.
Jan 24 2022, 5:07 AM · Restricted Project, Restricted Project
chfast updated the summary of D118035: [test][DAGCombine] Add tests for combining carry diamond. NFC.
Jan 24 2022, 4:28 AM · Restricted Project
chfast requested review of D118035: [test][DAGCombine] Add tests for combining carry diamond. NFC.
Jan 24 2022, 4:21 AM · Restricted Project

Jan 22 2022

chfast added a comment to D117680: [InstCombine] Simplify bswap -> shift.

I have noticed this post about undef/poison: https://llvm.discourse.group/t/evolution-of-undef-and-poison-over-time/5917/2.
Should I have added tests with poison instead of undef?

Jan 22 2022, 4:33 AM · Restricted Project

Jan 20 2022

chfast committed rG1d7604fdcebd: [InstCombine] Simplify bswap -> shift (authored by chfast).
[InstCombine] Simplify bswap -> shift
Jan 20 2022, 4:26 PM
chfast closed D117680: [InstCombine] Simplify bswap -> shift.
Jan 20 2022, 4:26 PM · Restricted Project
chfast updated the diff for D117680: [InstCombine] Simplify bswap -> shift.

Trigger rebuild.

Jan 20 2022, 3:47 PM · Restricted Project
chfast committed rG8457b61699e8: [test] Add tests for bswap combining. NFC (authored by chfast).
[test] Add tests for bswap combining. NFC
Jan 20 2022, 3:21 PM