Page MenuHomePhabricator

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

PaoloS (Paolo Savini)
User

Projects

User does not belong to any projects.

User Details

User Since
Jul 11 2019, 4:02 AM (230 w, 1 d)

Recent Activity

Sep 13 2021

PaoloS added a comment to D98932: [RISCV] Don't call setHasMultipleConditionRegisters(), so icmp is sunk.

Hi @philipp.tomsich do you know which change is that? Has it been already upstreamed? Because as far as I see by rebasing this patch on the upstream main we still have some code size reduction and the tests still succeed

Sep 13 2021, 8:27 AM · Restricted Project
PaoloS added a comment to D98932: [RISCV] Don't call setHasMultipleConditionRegisters(), so icmp is sunk.

Is this still being looked at? I see that by disabling HasMultpipleConditionRegisters upstream we still get better code size with embench.

Sep 13 2021, 4:25 AM · Restricted Project

Jul 8 2021

PaoloS added a comment to D98932: [RISCV] Don't call setHasMultipleConditionRegisters(), so icmp is sunk.

I quite agree that hasMultipleConditionRegisters seems to be intended for targets like PowerPC (only when it treats the 32 bits of the condition register as separate entities).
It also seems to me that the hook was added to RISCV as a simpler way make the RISCV backend lower select into more more logic instructions and fewer branches, as explained here: https://reviews.llvm.org/D79268
This wasn't probably very descriptive of the condition registers situation of RISCV that differs from the one of PowerPC (and AMDGPU) for which the hook was made for.
As already said, due to a previous commit, the hook hasMultipleConditionRegisters also influences (prevents) the sinking of compare instructions (sinkCmpExpression) and I found myself that by sinking them we get better code size.
I ran the benchmarks of Embench (https://github.com/embench/embench-iot) with a custom option I added (for proof of concept: https://reviews.llvm.org/D105620) and saw that by turning off that hook we achieve better code size.
I think that the idea to create another hook that is specific to the lowering of the select instructions is good. If that's preferable to overriding shouldNormalizeToSelectSequence to just return false.
(Hope you don't mind that I extracted part of your test for the test of my proof of concept: https://reviews.llvm.org/D105620, it was neat)

Jul 8 2021, 6:46 AM · Restricted Project
PaoloS updated the diff for D105620: [PoC][DO_NOT_MERGE] Add llc option to switch on and off hasMultipleConditionRegisters feature from a target..

Fixed the test to reflect the effects of the hasMultipleConditionRegisters on the lowering of select and the sinking of icmp.

Jul 8 2021, 6:27 AM · Restricted Project
PaoloS requested review of D105620: [PoC][DO_NOT_MERGE] Add llc option to switch on and off hasMultipleConditionRegisters feature from a target..
Jul 8 2021, 3:46 AM · Restricted Project

Jul 15 2020

PaoloS added a comment to D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.

No worries.
Thank you @lewis-revill

Jul 15 2020, 3:48 AM · Restricted Project

Jul 14 2020

PaoloS added a comment to D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.

Thank you very much @lewis-revill, very appreciated.
I haven't got commit access, can you @asb or someone else commit it for me?
Unless of course there's something else that needs immediate correction.

Jul 14 2020, 11:50 AM · Restricted Project
PaoloS updated the diff for D79875: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbt asm instructions.

Added comments to inefficient tests.

Jul 14 2020, 11:44 AM · Restricted Project
PaoloS updated the diff for D79874: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbs asm instructions.

Added comments to inefficient tests.

Jul 14 2020, 11:43 AM · Restricted Project
PaoloS updated the diff for D79873: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbbp asm instructions.

Aligned complex pattern declaration.
Clarified comment about missing 'roli' instruction.
Added comment to inefficient tests.

Jul 14 2020, 11:41 AM · Restricted Project
PaoloS updated the diff for D79871: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbp asm instructions.

Making sure the changes from patch zbb are maintained.

Jul 14 2020, 11:39 AM · Restricted Project
PaoloS updated the diff for D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.

Aligned the declarations of the complex patterns.
Added comments to inefficient tests.

Jul 14 2020, 11:37 AM · Restricted Project
PaoloS added inline comments to D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.
Jul 14 2020, 10:25 AM · Restricted Project
PaoloS added inline comments to D79873: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbbp asm instructions.
Jul 14 2020, 10:25 AM · Restricted Project
PaoloS added inline comments to D79875: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbt asm instructions.
Jul 14 2020, 10:24 AM · Restricted Project
PaoloS added inline comments to D79873: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbbp asm instructions.
Jul 14 2020, 8:28 AM · Restricted Project
PaoloS added inline comments to D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.
Jul 14 2020, 8:28 AM · Restricted Project
PaoloS updated the summary of D79875: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbt asm instructions.
Jul 14 2020, 6:58 AM · Restricted Project
PaoloS updated the summary of D79874: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbs asm instructions.
Jul 14 2020, 6:57 AM · Restricted Project
PaoloS updated the summary of D79873: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbbp asm instructions.
Jul 14 2020, 6:55 AM · Restricted Project
PaoloS updated the summary of D79871: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbp asm instructions.
Jul 14 2020, 6:15 AM · Restricted Project
PaoloS updated the summary of D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.
Jul 14 2020, 6:13 AM · Restricted Project

Jul 13 2020

PaoloS updated the diff for D79875: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbt asm instructions.

Updated the test:

  • the tests have been updated from the top of all the sub-patches together so that they are exactly the same as they would be if updated with the whole final patch.
  • labels specific to the sub-extension have been added alongside the generic RISCVIB label (that activates all the sub-extensions) so that we can see how differently the patterns are matched with the specific subextension or with all of them together.
  • the tests will probably fail if run by checking out the commit of a subextension and if updated they'll change. These tests are designed to work with the final squashed patch.
Jul 13 2020, 12:34 PM · Restricted Project
PaoloS updated the diff for D79874: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbs asm instructions.

Updated the test:

  • the tests have been updated from the top of all the sub-patches together so that they are exactly the same as they would be if updated with the whole final patch.
  • labels specific to the sub-extension have been added alongside the generic RISCVIB label (that activates all the sub-extensions) so that we can see how differently the patterns are matched with the specific subextension or with all of them together.
  • the tests will probably fail if run by checking out the commit of a subextension and if updated they'll change. These tests are designed to work with the final squashed patch.
Jul 13 2020, 12:32 PM · Restricted Project
PaoloS updated the diff for D79873: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbbp asm instructions.

Updated the test:

  • the tests have been updated from the top of all the sub-patches together so that they are exactly the same as they would be if updated with the whole final patch.
  • labels specific to the sub-extension have been added alongside the generic RISCVIB label (that activates all the sub-extensions) so that we can see how differently the patterns are matched with the specific subextension or with all of them together.
  • the tests will probably fail if run by checking out the commit of a subextension and if updated they'll change. These tests are designed to work with the final squashed patch.
Jul 13 2020, 12:28 PM · Restricted Project
PaoloS updated the diff for D79871: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbp asm instructions.

Updated the test:

  • the tests have been updated from the top of all the sub-patches together so that they are exactly the same as they would be if updated with the whole final patch.
  • labels specific to the sub-extension have been added alongside the generic RISCVIB label (that activates all the sub-extensions) so that we can see how differently the patterns are matched with the specific subextension or with all of them together.
  • the tests will probably fail if run by checking out the commit of a subextension and if updated they'll change. These tests are designed to work with the final squashed patch.
Jul 13 2020, 12:27 PM · Restricted Project
PaoloS updated the diff for D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.

Updated the test:

  • the tests have been updated from the top of all the sub-patches together so that they are exactly the same as they would be if updated with the whole final patch.
  • labels specific to the sub-extension have been added alongside the generic RISCVIB label (that activates all the sub-extensions) so that we can see how differently the patterns are matched with the specific subextension or with all of them together.
  • the tests will probably fail if run by checking out the commit of a subextension and if updated they'll change. These tests are designed to work with the final squashed patch.
Jul 13 2020, 12:23 PM · Restricted Project

Jul 9 2020

PaoloS updated the diff for D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.

Fixed indentation.
Added architecture type control for complex pattern matching of sloiw, sroiw and slliuw.

Jul 9 2020, 7:33 PM · Restricted Project
PaoloS added inline comments to D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.
Jul 9 2020, 7:24 PM · Restricted Project
PaoloS added a comment to D79874: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbs asm instructions.

I had to exclude the test of the pattern of sbclr_i64 on RV32 because it caused a warning of asm conflicts. Also the cross tests i64 on RV32 are quite noisy here. I'd rather keep them though as they show quite efficient results on many other instructions in other subextensions.

Jul 9 2020, 6:56 PM · Restricted Project
PaoloS updated the diff for D79874: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbs asm instructions.

Added pattern-matching for sbexti, sbclrw, sbsetw, sbinvw and sbextw.
Added correspondent codegen tests.
Reorganized the tests so that both 32 and 64 bit files have both 32 and 64 bit versions of each test.
Fixed some imprecise patterns due to unnecessary constant truncations.

Jul 9 2020, 6:50 PM · Restricted Project
PaoloS added inline comments to D79874: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbs asm instructions.
Jul 9 2020, 6:45 PM · Restricted Project
PaoloS added inline comments to D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.
Jul 9 2020, 8:38 AM · Restricted Project
PaoloS added inline comments to D79873: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbbp asm instructions.
Jul 9 2020, 8:37 AM · Restricted Project

Jul 7 2020

PaoloS updated the diff for D79873: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbbp asm instructions.

Added missing pattern-matching for *w instructions.
Added tests.
Added both i32 and i64 code versions to both i32 and i64 test files.
Removed NOT labels from tests.

Jul 7 2020, 5:53 PM · Restricted Project
PaoloS updated the diff for D79871: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbp asm instructions.

Add missing pattern-matching for *w instructions.
Add tests.
Add both i32 and i64 code versions to both i32 and i64 test files.
Remove NOT labels from tests.

Jul 7 2020, 5:36 PM · Restricted Project
PaoloS added a comment to D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.

Just a clarification. I decided to split the tests into 32bit and 64bit because the 32bit code compiled on RV64 commonly produces sign-extended IR and that's when many *w instructions are selected. A version of the tests in a unique file could imply on one hand to have 32 bit IR with sign-extension compiled for RV32 (harmless but redundant), on the other hand we would have i32 code with no explicit sign-extension compiled for RV32. That is correct but it might lead to misleading selections, like pattern-matching the IR code of a 32bit SLOI on RV64 with a RV64 SLOI instead of a SLOIW (the difference is that SLOIW ignores the upper 32 bit of the result while RV64 doesn't).

Jul 7 2020, 4:12 PM · Restricted Project
PaoloS updated the diff for D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.

Added missing pattern-matching for *w instructions.
Added codegen tests.
Added ComplexPattern instances that are crucial to pattern-match SLOI, SROI, SLOIW, SROIW and SLLIUW.
Both 32 and 64 bit test files have both 32 and 64 bit test cases of the instructions (were existing).

Jul 7 2020, 4:04 PM · Restricted Project

Jun 25 2020

PaoloS added inline comments to D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.
Jun 25 2020, 5:15 AM · Restricted Project
PaoloS added a comment to D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.

Sorry for the late answer.
I'm catching up with this now.

Jun 25 2020, 5:15 AM · Restricted Project

May 13 2020

PaoloS added a comment to D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..

As suggested I split the patch by subextension.
You can find in order the pieces that add pattern-matching for zbb, zbp, zbbp, zbs and zbt here:

May 13 2020, 9:10 AM · Restricted Project
PaoloS created D79875: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbt asm instructions.
May 13 2020, 9:10 AM · Restricted Project
PaoloS created D79874: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbs asm instructions.
May 13 2020, 9:10 AM · Restricted Project
PaoloS created D79873: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbbp asm instructions.
May 13 2020, 9:10 AM · Restricted Project
PaoloS created D79871: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbp asm instructions.
May 13 2020, 8:38 AM · Restricted Project
PaoloS created D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions.
May 13 2020, 8:38 AM · Restricted Project

May 7 2020

PaoloS added a comment to D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..

Thanks Alex.
Yes splitting it sounds reasonable. It is indeed quite a big monolithic patch and I struggle to review it myself sometimes.
Splitting it into subsets sounds a practical approach, will do.

May 7 2020, 6:45 AM · Restricted Project

Apr 15 2020

PaoloS updated the diff for D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..

Fixed indentation.
Regrouped/rearranged the patterns to follow the order of the instructions in the encoding table in the specs.
Removed autogenerated comments in the tests.

Apr 15 2020, 11:30 AM · Restricted Project
PaoloS added inline comments to D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..
Apr 15 2020, 11:30 AM · Restricted Project

Apr 14 2020

PaoloS added inline comments to D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..
Apr 14 2020, 9:38 AM · Restricted Project

Apr 10 2020

PaoloS updated the diff for D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..

Fixed the order of the patterns according to follow the order in the opcode table in the specs.
Same for the tests.
Fixed the flags of the tests.
Removed duplicate patterns.
Added pattern matching for rev8.h from bswap.
Removed underscores from names of the functions in the tests.
Wrapped indentation to fit into 80 columns.

Apr 10 2020, 10:25 AM · Restricted Project
PaoloS added inline comments to D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..
Apr 10 2020, 10:19 AM · Restricted Project

Mar 29 2020

PaoloS updated the diff for D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.
  • Changed some instruction template classes so that they are not based directly on the basic RVInst.
  • Changed the indentation where possible so that it fits in 80 columns.
  • Fixed some obsolete comments.
  • Added some runs to the Zbp tests.
  • Fixed other indentation problems.
Mar 29 2020, 1:55 PM · Restricted Project

Mar 25 2020

PaoloS updated the diff for D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.

Fixed obsolete comments.

Mar 25 2020, 7:00 AM · Restricted Project
PaoloS updated the diff for D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.
  • Added bitmanip compressed instructions.
  • Added compressed instruction emission.
  • Added mc tests.
  • Added assembler predicate strings to B extension and subextensions.
  • Fixed typos.
  • Fixed the order of the single bit instructions.
Mar 25 2020, 6:59 AM · Restricted Project

Mar 24 2020

PaoloS added inline comments to D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.
Mar 24 2020, 5:20 AM · Restricted Project
PaoloS updated the diff for D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.
  • Sorted the definitions of the instructions and the MC tests according to the order of the encodings in the manual.
  • Improved the names of the instruction templates.
  • Removed unused operand types and instruction templates.
  • The features hasSideEffects, mayLoad and mayStore are now set only on the templates that need it.
  • Renamed all the immediate parameters in the templates as 'shamt', for uniformity.
  • Split the funct12 field of the unary instruction template into two fields of 7 and 5 bits. For conformity to the manual and for maintainability.
  • Added a 4-bit immediate operand for the 32 bit shuffle.
  • Added constraints on the size of the immediate operands.
  • Added tests on the constraints of the immediate operands.
  • Renamed most registers in the tests for uniformity.
  • Removed the compressed instructions as they are still a proposal for the C extension and still cause encoding conflicts with the ones aready implemented there.
  • Removed tests of compressed instructions.
Mar 24 2020, 5:20 AM · Restricted Project

Mar 19 2020

PaoloS added inline comments to D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.
Mar 19 2020, 2:15 PM · Restricted Project
PaoloS added inline comments to D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.
Mar 19 2020, 9:10 AM · Restricted Project

Feb 3 2020

PaoloS updated the diff for D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.

Added empty scheduling descriptions, just to let it build with the upstream LLVM.

Feb 3 2020, 6:25 AM · Restricted Project

Dec 3 2019

PaoloS updated the summary of D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.
Dec 3 2019, 8:50 AM · Restricted Project
PaoloS updated the diff for D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..

Update codegen pattern matching to RISCV BitManip v0.92:

Dec 3 2019, 4:04 AM · Restricted Project

Nov 28 2019

PaoloS added inline comments to D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..
Nov 28 2019, 9:28 AM · Restricted Project

Nov 15 2019

PaoloS updated the diff for D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.

Update encodings to RISCV BitManip v0.92:

Nov 15 2019, 2:14 AM · Restricted Project

Oct 2 2019

PaoloS updated the diff for D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..

Added matching of LLVM bit manipulation instrinsics like bswap, bitreverse, fshl and fshr to the corresponding asm instructions in the RISC-V bit manipulation ISA extension. Added codegen tests accordingly. Added codegen tests for the intrinsics ctlz, cttz and ctpop, to check that they are matched with the assembly instructions clz, ctz and pcnt.

Oct 2 2019, 8:35 AM · Restricted Project

Sep 17 2019

PaoloS updated the diff for D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..

Removed new lines and trailing spaces.

Sep 17 2019, 11:11 AM · Restricted Project
PaoloS updated the diff for D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.

Removed new line.

Sep 17 2019, 10:52 AM · Restricted Project
PaoloS updated the diff for D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..

Updated tests that failed due to latest commit in LLVM.

Sep 17 2019, 10:11 AM · Restricted Project

Sep 13 2019

PaoloS added inline comments to D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.
Sep 13 2019, 3:25 AM · Restricted Project

Sep 9 2019

PaoloS updated the summary of D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..
Sep 9 2019, 4:46 AM · Restricted Project
PaoloS created D67348: [RISCV] Add codegen pattern matching for bit manipulation assembly instructions..
Sep 9 2019, 4:36 AM · Restricted Project

Sep 4 2019

PaoloS updated the diff for D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.

Fixed immediate values of shfli/unshfli for zip/unzip pseudo instructions.

Sep 4 2019, 10:56 AM · Restricted Project

Sep 2 2019

PaoloS updated the diff for D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.

Update the encodings to the latest version of the spec. Fix the tests and encoding conflicts.

Sep 2 2019, 4:43 AM · Restricted Project

Aug 30 2019

PaoloS updated the diff for D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.

Added the latest updates to the encodings of the instructions, including the gorc, gorci, bfp instructions, the 'orc' pseudo instructions based on gorci and the zip/unzip pseudo instructions based on shfli/unshfli. Changed the encoding of grev and bmatxor to make space for gorc. Added the subtarget feature Zbf to support bfp. Added the necessary MC tests.

Aug 30 2019, 8:38 AM · Restricted Project

Aug 7 2019

PaoloS updated the diff for D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.

Fixed the indentation of the tests.

Aug 7 2019, 10:19 AM · Restricted Project
PaoloS updated the diff for D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.

Fixed typos, bad indentations and capitalization.
Added uimm6 and uimm7 riscv asm operand types in order to have more precise classes to represent the templates of the instructions with 5-bit, 6-bit and 7-bit immediate fields. The riscv asm operand uimm5 already existed.
Added missing rev pseudo instructions for riscv64.
Fixed the tests accordingly.
Added comments.

Aug 7 2019, 8:48 AM · Restricted Project

Aug 2 2019

PaoloS created D65649: [RISCV] Add MC encodings and tests of the Bit Manipulation extension.
Aug 2 2019, 6:13 AM · Restricted Project