Page MenuHomePhabricator
Feed Advanced Search

May 16 2022

alexey.zhikhar updated subscribers of D124394: [DFAJumpThreading] Relax analysis to handle unpredictable initial values.

Hi Sjoerd and JinGu, I remember from your comments on the initial DFAJumpThreading patch, that you guys are interested in the opportunities in SPEC2017 perlbench. I wanted to let you know that this patch introduces a limit on the number of threaded paths per switch. The limit is 200 paths, that means that if a switch has 1,000 potential path candidates, only 200 of them will get threaded, the rest of them will circle back to the switch instruction the usual way. The thing is that perlbench has several switches optimized by DFAJumpThreading, and a couple of them have the number of paths above the limit (in the thousands). Due to the limit, these switches are threaded partially, which might lead to performance regressions.

May 16 2022, 8:43 AM · Restricted Project, Restricted Project

May 4 2022

alexey.zhikhar added a comment to D124394: [DFAJumpThreading] Relax analysis to handle unpredictable initial values.

No noticeable compile time impact.

May 4 2022, 8:04 AM · Restricted Project, Restricted Project
alexey.zhikhar added a comment to D124394: [DFAJumpThreading] Relax analysis to handle unpredictable initial values.

Compare the number of switches threaded before and after this patch.

May 4 2022, 8:02 AM · Restricted Project, Restricted Project
alexey.zhikhar updated the diff for D124394: [DFAJumpThreading] Relax analysis to handle unpredictable initial values.

Limit the number of paths explored to contain compile time.

May 4 2022, 8:00 AM · Restricted Project, Restricted Project

Apr 25 2022

alexey.zhikhar added a comment to D124394: [DFAJumpThreading] Relax analysis to handle unpredictable initial values.

I'm getting compile time numbers, will submit them soon. We're also planning on adding more test cases before the patch is merged.

Apr 25 2022, 8:33 AM · Restricted Project, Restricted Project
alexey.zhikhar added a comment to D124394: [DFAJumpThreading] Relax analysis to handle unpredictable initial values.

Code size increase is very small.

Apr 25 2022, 8:32 AM · Restricted Project, Restricted Project
alexey.zhikhar updated the summary of D124394: [DFAJumpThreading] Relax analysis to handle unpredictable initial values.
Apr 25 2022, 8:31 AM · Restricted Project, Restricted Project
alexey.zhikhar requested review of D124394: [DFAJumpThreading] Relax analysis to handle unpredictable initial values.
Apr 25 2022, 8:30 AM · Restricted Project, Restricted Project

Mar 21 2022

alexey.zhikhar added a comment to D122122: [Docs] Add documentation for ongoing major changes.

Also it would be interesting to have here some status/future plans/ideas to explore for new passes like CE by @fhahn, SLP with memory versioning, LoopFlatten, FuncSpecialization, DFA pass, etc..

@SjoerdMeijer
@aeubanks
@alexey.zhikhar

Mar 21 2022, 12:55 PM · Restricted Project, Restricted Project

Feb 1 2022

alexey.zhikhar added a comment to D118590: [DFAJumpThreading] make update order deterministic.

There are some seemingly unrelated failures in the Debian build. How do we handle that?

Feb 1 2022, 6:08 AM · Restricted Project
alexey.zhikhar accepted D118590: [DFAJumpThreading] make update order deterministic.
Feb 1 2022, 6:07 AM · Restricted Project

Jan 31 2022

alexey.zhikhar added a comment to D118590: [DFAJumpThreading] make update order deterministic.

Thank you @ollef this LGTM

Jan 31 2022, 4:31 PM · Restricted Project
alexey.zhikhar added inline comments to D118590: [DFAJumpThreading] make update order deterministic.
Jan 31 2022, 11:11 AM · Restricted Project

Dec 23 2021

alexey.zhikhar added a comment to D59260: [DAGCombiner] If a TokenFactor would be merged into its user, consider the user later..

@niravd Hi Nirav, my team and I discovered a compile time regression due to this patch. I submitted a bug report for it, we would really appreciate if you could take a look at it:

Dec 23 2021, 1:11 PM · Restricted Project

Dec 15 2021

alexey.zhikhar added a comment to D115832: [DFAJumpThreading] Determinator BB should precede switch-defining BB.

I attach a picture of the CFG illustrating the problem in one of the llvm-test-suite tests that was failing on X86.

Dec 15 2021, 2:45 PM · Restricted Project
alexey.zhikhar requested review of D115832: [DFAJumpThreading] Determinator BB should precede switch-defining BB.
Dec 15 2021, 2:40 PM · Restricted Project

Aug 3 2021

alexey.zhikhar added a comment to D99205: Add jump-threading optimization for deterministic finite automata.

Thanks everybody.

Aug 3 2021, 10:30 AM · Restricted Project

Jul 30 2021

alexey.zhikhar added a comment to D99205: Add jump-threading optimization for deterministic finite automata.

Compile time statistics gathered on CTMark (no change, basically):

Jul 30 2021, 7:58 AM · Restricted Project

Jul 29 2021

alexey.zhikhar added inline comments to rG02077da7e7a8: Add jump-threading optimization for deterministic finite automata.
Jul 29 2021, 8:34 AM

Jul 27 2021

alexey.zhikhar added a comment to D99205: Add jump-threading optimization for deterministic finite automata.

Thanks guys

Jul 27 2021, 12:52 PM · Restricted Project
alexey.zhikhar updated the summary of D99205: Add jump-threading optimization for deterministic finite automata.
Jul 27 2021, 7:38 AM · Restricted Project

Jul 26 2021

alexey.zhikhar updated the diff for D99205: Add jump-threading optimization for deterministic finite automata.

Rebase on top of the latest main

Jul 26 2021, 3:57 PM · Restricted Project

Jul 23 2021

alexey.zhikhar added a comment to D99205: Add jump-threading optimization for deterministic finite automata.

Thanks, looking good. But one last request, sorry, can you add tests for the optimisation remarks too?

Jul 23 2021, 6:07 AM · Restricted Project

Jul 22 2021

alexey.zhikhar added inline comments to D99205: Add jump-threading optimization for deterministic finite automata.
Jul 22 2021, 2:46 PM · Restricted Project
alexey.zhikhar updated the diff for D99205: Add jump-threading optimization for deterministic finite automata.
  • Add a test for the minsize attribute
  • Test MaxPathDepth with a test case where only a subset of paths is threaded
  • Reduce the test case for the cost model by passing the threshold through CLI
  • Fix a bug in how the NumTransforms statistic is incremented
  • Expand the cost model to include the case for jump tables
Jul 22 2021, 2:42 PM · Restricted Project

Jul 14 2021

alexey.zhikhar added inline comments to D99205: Add jump-threading optimization for deterministic finite automata.
Jul 14 2021, 2:52 PM · Restricted Project
alexey.zhikhar updated the diff for D99205: Add jump-threading optimization for deterministic finite automata.
  • Add optimization remark emitter
  • Test for min code size
  • Test with blocks that cannot be cloned
  • Test with some unsupported instructions
  • Test unpredictable switch
  • Replace all mentions of FSM with DFA
  • Always use the term "Threading Path", instead of interchanging "threading" with "threadable"
Jul 14 2021, 2:37 PM · Restricted Project

Jul 13 2021

alexey.zhikhar added a comment to D99205: Add jump-threading optimization for deterministic finite automata.

Thanks for the updates.
If I am not mistaken, I still think tests are missing for cases when jump threading should *not* trigger:

I think some tests are missing, mostly negative tests:

  • test for min code size,
  • test with blocks that cannot be cloned,
  • test with some unsupported instructions
Jul 13 2021, 7:51 AM · Restricted Project

Jul 12 2021

alexey.zhikhar added inline comments to D99205: Add jump-threading optimization for deterministic finite automata.
Jul 12 2021, 2:02 PM · Restricted Project
alexey.zhikhar updated the diff for D99205: Add jump-threading optimization for deterministic finite automata.
Jul 12 2021, 1:53 PM · Restricted Project

Jul 9 2021

alexey.zhikhar added inline comments to D99205: Add jump-threading optimization for deterministic finite automata.
Jul 9 2021, 1:53 PM · Restricted Project
alexey.zhikhar updated the diff for D99205: Add jump-threading optimization for deterministic finite automata.

Addressed the inline comments, added a co-author.

Jul 9 2021, 1:43 PM · Restricted Project
alexey.zhikhar added inline comments to D99205: Add jump-threading optimization for deterministic finite automata.
Jul 9 2021, 9:32 AM · Restricted Project

Jun 24 2021

alexey.zhikhar added a comment to D99205: Add jump-threading optimization for deterministic finite automata.

@efriedma ping.

Jun 24 2021, 1:59 PM · Restricted Project

Jun 16 2021

alexey.zhikhar added a comment to D99205: Add jump-threading optimization for deterministic finite automata.

@efriedma Eli, I believe all your comments have been addressed, please take another look when you get a chance, thanks.

Jun 16 2021, 3:05 PM · Restricted Project

Jun 11 2021

alexey.zhikhar updated the diff for D99205: Add jump-threading optimization for deterministic finite automata.

Fix a clang-format warning

Jun 11 2021, 12:54 PM · Restricted Project

Jun 9 2021

alexey.zhikhar updated the diff for D99205: Add jump-threading optimization for deterministic finite automata.

Fixed the bug submitted by @dnsampaio, test case added

Jun 9 2021, 7:03 AM · Restricted Project
alexey.zhikhar commandeered D99205: Add jump-threading optimization for deterministic finite automata.
Jun 9 2021, 7:00 AM · Restricted Project

Jun 7 2021

alexey.zhikhar added a comment to D99205: Add jump-threading optimization for deterministic finite automata.

Thanks for all of the effort! On our downstream Cortex-R5 compiler, I'm seeing a 20.4% speedup on Coremark with this patch, which is good, however, the older patch (https://reviews.llvm.org/D88307) gave me a 21.6% speedup. Any idea what could account for the difference there?

Jun 7 2021, 8:45 AM · Restricted Project

Mar 12 2020

alexey.zhikhar added inline comments to D75943: [LoopInterchange] Fix interchanging contents of preheader BBs.
Mar 12 2020, 9:46 AM · Restricted Project
alexey.zhikhar updated the diff for D75943: [LoopInterchange] Fix interchanging contents of preheader BBs.

Addressed the rest of Florian's comments.

Mar 12 2020, 9:46 AM · Restricted Project
alexey.zhikhar retitled D75943: [LoopInterchange] Fix interchanging contents of preheader BBs from [LoopInterchange] Do not break LCSSA to [LoopInterchange] Fix interchanging contents of preheader BBs.
Mar 12 2020, 9:46 AM · Restricted Project

Mar 11 2020

alexey.zhikhar added inline comments to D75943: [LoopInterchange] Fix interchanging contents of preheader BBs.
Mar 11 2020, 10:45 AM · Restricted Project
alexey.zhikhar updated the diff for D75943: [LoopInterchange] Fix interchanging contents of preheader BBs.

Addressed part of Florian's comments.

Mar 11 2020, 10:45 AM · Restricted Project

Mar 10 2020

alexey.zhikhar added a comment to D75943: [LoopInterchange] Fix interchanging contents of preheader BBs.

CFG before the patch, LCSSA broken:

Mar 10 2020, 10:20 AM · Restricted Project
alexey.zhikhar created D75943: [LoopInterchange] Fix interchanging contents of preheader BBs.
Mar 10 2020, 10:19 AM · Restricted Project

Feb 13 2020

alexey.zhikhar added a comment to D68515: [PATCH 20/27] [noalias] SROA/PromoteMemoryToRegister: Learn how to handle noalias intrinsics.

Is the bitcast introduced by 'clang' (frontend), or was it introduced by one of the optimization passes ? In the latter case, which pass is this? We should probably handle it and
treat it as a 'gep with all-0 indices'... And make sure that the pointer-type for the llvm.noalias is somewhat usable.

If it is based on 'a pointer to int' conversion in the c-language, then it should be ok to just ignore it.

Feb 13 2020, 7:21 AM · Restricted Project

Feb 11 2020

alexey.zhikhar added a comment to D68515: [PATCH 20/27] [noalias] SROA/PromoteMemoryToRegister: Learn how to handle noalias intrinsics.

Jeroen, we discovered an assertion in introduceNoAliasWhenCopyGuardIndicesAreCompatible() for the case described below; we would appreciate your input.

Feb 11 2020, 4:11 PM · Restricted Project

Mar 22 2019

alexey.zhikhar added a comment to D52896: MergeSimilarFunctions 1/n: a code size pass to merge functions with small differences.

@hiraditya Thank you very much for the code, I'm very interested in it. I'm trying to compile this and the 2/n revision together but I'm getting compilation failures, e.g.:

Mar 22 2019, 11:00 AM · Restricted Project

Aug 7 2018

alexey.zhikhar added a comment to D49994: Allow constraining virtual register's class within reason.

I'd like an explanation for why the generated code is changing for AArch64... generating extra copies clearly seems like a downside. And there isn't any obvious reason for this change to impact register allocation: on AArch64, all i32 register classes contain exactly the same set of allocatable registers.

Aug 7 2018, 1:30 PM
alexey.zhikhar added a reviewer for D49994: Allow constraining virtual register's class within reason: t.p.northover.

For some of the failing ARM/AArch64 tests, I see additional mov-s being performed; for example, in CodeGen/AArch64/and-sink.ll: if you take a look at the assembly after applying the patch, you will see an addtional mov for the trace when %c (w1) equals to zero. I'm not sure how important it is, so I would appreciate some feedback from ARM/AArch64 backend people. Please note that for performance-critical atomic compare-and-swap operations, performance is unchanged.

Aug 7 2018, 12:13 PM
alexey.zhikhar updated the diff for D49994: Allow constraining virtual register's class within reason.

Differential is updated with:

Aug 7 2018, 12:10 PM

Aug 1 2018

alexey.zhikhar added a comment to D49994: Allow constraining virtual register's class within reason.

All the test failures are mismatches between expected assembly and assembly produced. One exception is CodeGen/AMDGPU/early-if-convert.ll, where the backend fails with an assertion:

Aug 1 2018, 10:42 AM
alexey.zhikhar added a comment to D49994: Allow constraining virtual register's class within reason.

The new code for f2 in cond-move-03.ll is in fact better, since it now actually uses the conditional move instruction instead of a branch ...

Aug 1 2018, 10:26 AM
alexey.zhikhar added a comment to D49994: Allow constraining virtual register's class within reason.

@jonpa Jonas, I see a different assembly in one of SystemZ unit tests; my memory of Z is pretty fuzzy, so could you please make sense of the change to see whether it is reasonable?

Aug 1 2018, 9:24 AM

Jul 31 2018

alexey.zhikhar added a comment to D49994: Allow constraining virtual register's class within reason.

This patch fails 14 tests; however, it seems that the problem is not in the patch but in flaky test cases. I took a quick look at CodeGen/PowerPC/vsx.ll: the test case fails after not finding copy instructions, which were redundant and expectedly removed by this patch.

Jul 31 2018, 8:23 AM
alexey.zhikhar added a comment to D49994: Allow constraining virtual register's class within reason.

This patch fails 14 tests; however, it seems that the problem is not in the patch but in flaky test cases. I took a quick look at CodeGen/PowerPC/vsx.ll: the test case fails after not finding copy instructions, which were redundant and expectedly removed by this patch.

Jul 31 2018, 6:01 AM
alexey.zhikhar added a comment to D49994: Allow constraining virtual register's class within reason.

Is this making sense, and what are your thoughts? What happens if you run your out-of-tree test cases with the SystemZ (-mcpu=z13) backend? Do you see any improvement? In that case, it seems like we have a test of real worth...

Jul 31 2018, 5:45 AM

Jul 30 2018

alexey.zhikhar added a comment to D49994: Allow constraining virtual register's class within reason.

Probably needs tests. (Not that i know how to write one here)

Jul 30 2018, 10:26 AM
alexey.zhikhar updated the summary of D49994: Allow constraining virtual register's class within reason.
Jul 30 2018, 10:14 AM
alexey.zhikhar updated the summary of D49994: Allow constraining virtual register's class within reason.
Jul 30 2018, 10:13 AM
alexey.zhikhar created D49994: Allow constraining virtual register's class within reason.
Jul 30 2018, 10:06 AM