Page MenuHomePhabricator

Petar.Avramovic (Petar Avramovic)
User

Projects

User does not belong to any projects.

User Details

User Since
Feb 21 2018, 6:39 AM (65 w, 1 d)

Recent Activity

Yesterday

Petar.Avramovic added a comment to D61289: [globalisel] Add G_SEXT_INREG.

Thanks for the explanation. Summary of inline discussion so far:
NarrowScalar G_SEXT_INREG cannot have decent (able to combine away artifacts) mir test with this patch alone since there are problems with artifact combiner.
Approach 1: narrowScalar G_SEXT_INREG with G_UNMERGE/G_MERGE + D61787. Able to perform all combines introduced so far and generates desired output.
Approach 2: narrowScalar G_SEXT_INREG with G_TRUNC/G_SEXT + TODO: introduce more artifacts combines and fix artifact combiner to support them.
I expect that both approaches should have similar performance and generate equivalent output.
Are there there cases where Approach 2 generates better code, as I am now convinced that Approach 2 will have similar (if not better ?) performance compared to Approach 1?

Wed, May 22, 5:39 AM · Restricted Project

Tue, May 21

Petar.Avramovic accepted D62166: [mips] Always check that `shift and add` optimization is efficient.

LGTM.

Tue, May 21, 7:50 AM · Restricted Project

Fri, May 17

Petar.Avramovic updated the diff for D61787: [GlobalISel Legalizer] Improve artifact combiner.

Addressed review comments.

Fri, May 17, 3:21 AM · Restricted Project

Wed, May 15

Petar.Avramovic added inline comments to D61787: [GlobalISel Legalizer] Improve artifact combiner.
Wed, May 15, 7:30 AM · Restricted Project
Petar.Avramovic added inline comments to D61787: [GlobalISel Legalizer] Improve artifact combiner.
Wed, May 15, 6:12 AM · Restricted Project

Fri, May 10

Petar.Avramovic added inline comments to D61289: [globalisel] Add G_SEXT_INREG.
Fri, May 10, 6:20 PM · Restricted Project
Petar.Avramovic added a comment to D61787: [GlobalISel Legalizer] Improve artifact combiner.

@volkan @aemerson @arsenm Here is brief explanation of changes in tests.

Fri, May 10, 8:38 AM · Restricted Project
Petar.Avramovic created D61787: [GlobalISel Legalizer] Improve artifact combiner.
Fri, May 10, 8:17 AM · Restricted Project
Petar.Avramovic added a comment to D61289: [globalisel] Add G_SEXT_INREG.

Most targets I know would select G_ZEXT_INREG to an AND using either an inline or materialized immediate at which point we haven't really gained anything by protecting it against harmful 'optimization'.

My only consideration was that is faster to narrow scalar G_ZEXT_INREG, then to narrow scalar G_AND and G_CONSTANT. On the other hand AND has simple narrow scalar unlike G_SHL and G_ASHR so it is not that big performance/code size improvement compared to G_SEXT_INREG. Also as sign and zero extend are most of the time mentioned together, I thought that we could add G_ZEXT_INREG alongside with G_SEXT_INREG.

Fri, May 10, 3:30 AM · Restricted Project

Tue, May 7

Petar.Avramovic added a comment to D61289: [globalisel] Add G_SEXT_INREG.

Perfect. What about G_ZEXT_INREG since it is more efficient to narrow scalar G_ZEXT_INREG then bitwise instruction with some bit mask?

Tue, May 7, 3:49 AM · Restricted Project

Apr 3 2019

Petar.Avramovic committed rGafa3afa384aa: [MIPS GlobalISel] Select floating point arithmetic operations (authored by Petar.Avramovic).
[MIPS GlobalISel] Select floating point arithmetic operations
Apr 3 2019, 7:12 AM
Petar.Avramovic committed rL357584: [MIPS GlobalISel] Select floating point arithmetic operations.
[MIPS GlobalISel] Select floating point arithmetic operations
Apr 3 2019, 7:12 AM
Petar.Avramovic closed D60191: [MIPS GlobalISel] Select floating point arithmetic operations.
Apr 3 2019, 7:12 AM · Restricted Project
Petar.Avramovic created D60191: [MIPS GlobalISel] Select floating point arithmetic operations.
Apr 3 2019, 3:39 AM · Restricted Project
Petar.Avramovic retitled D60191: [MIPS GlobalISel] Select floating point arithmetic operations from [MIPS GlobalISel] Select float arithmetic operations to [MIPS GlobalISel] Select floating point arithmetic operations.
Apr 3 2019, 3:39 AM · Restricted Project
Petar.Avramovic accepted D60132: [mips] Remove unused FGRH32 register class. NFC.

LGTM.

Apr 3 2019, 1:15 AM · Restricted Project

Mar 28 2019

Petar.Avramovic committed rG1af05df3de60: [MIPS GlobalISel] Select float constants (authored by Petar.Avramovic).
[MIPS GlobalISel] Select float constants
Mar 28 2019, 9:57 AM
Petar.Avramovic committed rL357183: [MIPS GlobalISel] Select float constants.
[MIPS GlobalISel] Select float constants
Mar 28 2019, 9:57 AM
Petar.Avramovic closed D59933: [MIPS GlobalISel] Select float constants.
Mar 28 2019, 9:56 AM · Restricted Project
Petar.Avramovic created D59933: [MIPS GlobalISel] Select float constants.
Mar 28 2019, 7:34 AM · Restricted Project
Petar.Avramovic added a comment to D59799: [wip][mips] Use AltOrders to prevent using odd FP-registers.

Both GNU assembler and LLVM show warning if odd floating-point register appears in an asm file. As far as I understand the -mno-odd-spreg prevents using odd registers by backend, but does not prevent inserting such registers into asm file directly by a user.

Thanks for clarification.

Mar 28 2019, 6:12 AM · Restricted Project

Mar 27 2019

Petar.Avramovic accepted D59884: [mips] Fix lowering a signed immediate for *.d MSA instructions.

LGTM.

Mar 27 2019, 10:05 AM · Restricted Project

Mar 26 2019

Petar.Avramovic added a comment to D59799: [wip][mips] Use AltOrders to prevent using odd FP-registers.

I don't see other reason for registers form OddSPRegClass to be declared as as Reserved other then to affect Allocation order in register allocation.
From description of nooddspreg : "Disable odd numbered single-precision registers". I would say that we only need to make sure that odd float registers can't be used during register allocation that is to affect Allocation order in some way to make sure odd registers don't appear there. I saw that similar problem for msa was handled with use of different register class (MSA128WRegClass or MSA128WEvensRegClass) in MipsSETargetLowering::emitCOPY_FW.
Here this is done with AltOrders without having to define registers from OddSPRegClass as Reserved. MipsGenRegisterInfo.inc also got smaller, everything looks good from my side.

Mar 26 2019, 10:49 AM · Restricted Project

Mar 25 2019

Petar.Avramovic committed rGa034a64f8420: [MIPS GlobalISel] Select copy for arguments from FPRBRegBank (authored by Petar.Avramovic).
[MIPS GlobalISel] Select copy for arguments from FPRBRegBank
Mar 25 2019, 4:39 AM
Petar.Avramovic committed rL356886: [MIPS GlobalISel] Select copy for arguments from FPRBRegBank.
[MIPS GlobalISel] Select copy for arguments from FPRBRegBank
Mar 25 2019, 4:37 AM
Petar.Avramovic closed D59644: [MIPS GlobalISel] Select copy for arguments from FPRBRegBank.
Mar 25 2019, 4:37 AM · Restricted Project
Petar.Avramovic committed rG3dfa368d5d7c: [MIPS GlobalISel] Add floating point register bank (authored by Petar.Avramovic).
[MIPS GlobalISel] Add floating point register bank
Mar 25 2019, 4:31 AM
Petar.Avramovic committed rL356883: [MIPS GlobalISel] Add floating point register bank.
[MIPS GlobalISel] Add floating point register bank
Mar 25 2019, 4:31 AM
Petar.Avramovic closed D59643: [MIPS GlobalISel] Add floating point register bank.
Mar 25 2019, 4:30 AM · Restricted Project
Petar.Avramovic committed rG5a457e08f6f9: [MIPS GlobalISel] Lower float and double arguments in registers (authored by Petar.Avramovic).
[MIPS GlobalISel] Lower float and double arguments in registers
Mar 25 2019, 4:23 AM
Petar.Avramovic committed rL356882: [MIPS GlobalISel] Lower float and double arguments in registers.
[MIPS GlobalISel] Lower float and double arguments in registers
Mar 25 2019, 4:22 AM
Petar.Avramovic closed D59642: [MIPS GlobalISel] Lower float and double arguments in registers.
Mar 25 2019, 4:22 AM · Restricted Project
Petar.Avramovic updated the diff for D59644: [MIPS GlobalISel] Select copy for arguments from FPRBRegBank.
Mar 25 2019, 3:03 AM · Restricted Project

Mar 21 2019

Petar.Avramovic added a parent revision for D59644: [MIPS GlobalISel] Select copy for arguments from FPRBRegBank: D59643: [MIPS GlobalISel] Add floating point register bank.
Mar 21 2019, 7:50 AM · Restricted Project
Petar.Avramovic added a child revision for D59642: [MIPS GlobalISel] Lower float and double arguments in registers: D59643: [MIPS GlobalISel] Add floating point register bank.
Mar 21 2019, 7:50 AM · Restricted Project
Petar.Avramovic added a child revision for D59643: [MIPS GlobalISel] Add floating point register bank: D59644: [MIPS GlobalISel] Select copy for arguments from FPRBRegBank.
Mar 21 2019, 7:50 AM · Restricted Project
Petar.Avramovic added a parent revision for D59643: [MIPS GlobalISel] Add floating point register bank: D59642: [MIPS GlobalISel] Lower float and double arguments in registers.
Mar 21 2019, 7:50 AM · Restricted Project
Petar.Avramovic created D59644: [MIPS GlobalISel] Select copy for arguments from FPRBRegBank.
Mar 21 2019, 7:50 AM · Restricted Project
Petar.Avramovic created D59643: [MIPS GlobalISel] Add floating point register bank.
Mar 21 2019, 7:46 AM · Restricted Project
Petar.Avramovic created D59642: [MIPS GlobalISel] Lower float and double arguments in registers.
Mar 21 2019, 7:45 AM · Restricted Project

Mar 18 2019

Petar.Avramovic accepted D59452: [mips] Fix crash on recursive using of .set.

LGTM.

Mar 18 2019, 4:18 AM · Restricted Project

Mar 15 2019

Petar.Avramovic added a comment to D59339: [GISel][Legalizer][WIP][RFC] Retry legalization for failing instrs when artifacts are around.

I did not consider the case where sequence of instruction is legal, but individual instructions are not.
Condition when we throw an error might become
if (ArtifactList.empty() && TryLaterArtifactList.empty())
but other then that, there is no conflicts with artifact combining so it should not be a problem.

Mar 15 2019, 7:12 AM · Restricted Project
Petar.Avramovic committed rG3e0da146ac2a: [MIPS GlobalISel] Improve selection of constants (authored by Petar.Avramovic).
[MIPS GlobalISel] Improve selection of constants
Mar 15 2019, 12:11 AM
Petar.Avramovic committed rL356238: [MIPS GlobalISel] Improve selection of constants.
[MIPS GlobalISel] Improve selection of constants
Mar 15 2019, 12:10 AM
Petar.Avramovic closed D59369: [MIPS GlobalISel] Improve selection of constants.
Mar 15 2019, 12:10 AM · Restricted Project

Mar 14 2019

Petar.Avramovic added a comment to D59339: [GISel][Legalizer][WIP][RFC] Retry legalization for failing instrs when artifacts are around.

I agree that this is an important issue and that it should be implemented. I have already done some work in this direction and you can find a description of my work in the following text. Any comment is very welcome.

Mar 14 2019, 10:09 AM · Restricted Project
Petar.Avramovic created D59369: [MIPS GlobalISel] Improve selection of constants.
Mar 14 2019, 9:09 AM · Restricted Project

Mar 12 2019

Petar.Avramovic added a comment to D58826: [MIPS GlobalISel] NarrowScalar G_SMULH.

I added this patch to show how we can handle G_SMULH in narrowScalarMul, will add the test in the future.

Mar 12 2019, 9:25 AM
Petar.Avramovic updated the diff for D58826: [MIPS GlobalISel] NarrowScalar G_SMULH.

Addressed review comments.

Mar 12 2019, 9:00 AM
Petar.Avramovic planned changes to D58826: [MIPS GlobalISel] NarrowScalar G_SMULH.
Mar 12 2019, 9:00 AM
Petar.Avramovic accepted D59045: [mips] Fix encoding of the `mov.d` command for microMIPS R6.

LGTM for the initial version of the patch.

Mar 12 2019, 8:50 AM · Restricted Project
Petar.Avramovic added a comment to D59045: [mips] Fix encoding of the `mov.d` command for microMIPS R6.

microMIPS r6 handles float move with FMOV_S_MMR6 instruction mappings in .td file, with that in mind we should do the same with the double move instruction.
Despite the fact that change in /lib/Target/Mips/MipsSEInstrInfo.cpp results in the same output for this test, it should be addressed in another patch. Goal of that patch would be to properly select microMIPS move instruction based on register class used in copy instruction.

Mar 12 2019, 8:49 AM · Restricted Project
Petar.Avramovic accepted D59046: [mips] Map SW instruction to its microMIPS R6 variant.

LGTM

Mar 12 2019, 8:31 AM · Restricted Project
Petar.Avramovic added a comment to D59046: [mips] Map SW instruction to its microMIPS R6 variant.

I see. I think that in order to keep up with current implementation of microMIPS r6 in MicroMips32r6InstrInfo.td we should map microMIPS instruction to its corresponding standard encoding instruction when necessary.
According to documentation cb e5 has assembler format swsp $ra, 20($sp) but since here both clang and gcc use assembler format sw $ra, 20($sp) I think that we should keep the same behavior.
I would prefer solution in which when target instruction is selected it cannot be changed later. Alternatively for efficiency pseudo instruction could be selected and expanded into target instruction later. This approach would allow faster localization if problem occurs.
Regarding microMIPS r6 implementation I think that we should add both " patterns / manual instruction select" and "instruction mapping" when possible for completeness, since both are present. "Instruction mapping" approach also introduces some code duplication since often there is no difference between microMIPS pre-r6 and r6 instructions.
I agree that mapping in .td file is the best solution here.

Mar 12 2019, 8:31 AM · Restricted Project

Mar 11 2019

Petar.Avramovic updated the diff for D58826: [MIPS GlobalISel] NarrowScalar G_SMULH.

Rebased

Mar 11 2019, 5:08 AM
Petar.Avramovic planned changes to D58826: [MIPS GlobalISel] NarrowScalar G_SMULH.
Mar 11 2019, 5:08 AM
Petar.Avramovic committed rG5229f47f9f5d: [MIPS GlobalISel] NarrowScalar G_UMULH (authored by Petar.Avramovic).
[MIPS GlobalISel] NarrowScalar G_UMULH
Mar 11 2019, 3:08 AM
Petar.Avramovic committed rL355815: [MIPS GlobalISel] NarrowScalar G_UMULH.
[MIPS GlobalISel] NarrowScalar G_UMULH
Mar 11 2019, 3:07 AM
Petar.Avramovic closed D58825: [MIPS GlobalISel] NarrowScalar G_UMULH.
Mar 11 2019, 3:07 AM · Restricted Project
Petar.Avramovic committed rG0b17e59b5cf4: [MIPS GlobalISel] NarrowScalar G_MUL (authored by Petar.Avramovic).
[MIPS GlobalISel] NarrowScalar G_MUL
Mar 11 2019, 3:02 AM
Petar.Avramovic committed rL355814: [MIPS GlobalISel] NarrowScalar G_MUL.
[MIPS GlobalISel] NarrowScalar G_MUL
Mar 11 2019, 3:01 AM
Petar.Avramovic closed D58824: [MIPS GlobalISel] NarrowScalar G_MUL.
Mar 11 2019, 3:01 AM · Restricted Project

Mar 8 2019

Petar.Avramovic updated the diff for D58825: [MIPS GlobalISel] NarrowScalar G_UMULH.

Rebased.

Mar 8 2019, 2:06 AM · Restricted Project

Mar 7 2019

Petar.Avramovic updated the diff for D58824: [MIPS GlobalISel] NarrowScalar G_MUL.

Addressed review comments.

Mar 7 2019, 7:58 AM · Restricted Project
Petar.Avramovic committed rG3d3120dc9ab5: [MIPS GlobalISel] Fix mul operands (authored by Petar.Avramovic).
[MIPS GlobalISel] Fix mul operands
Mar 7 2019, 5:28 AM
Petar.Avramovic committed rL355594: [MIPS GlobalISel] Fix mul operands.
[MIPS GlobalISel] Fix mul operands
Mar 7 2019, 5:27 AM
Petar.Avramovic closed D58715: [MIPS GlobalISel] Fix mul operands.
Mar 7 2019, 5:27 AM · Restricted Project
Petar.Avramovic added a comment to D59046: [mips] Map SW instruction to its microMIPS R6 variant.

SWSP instruction has the same encoding for both standard and r6 microMIPS (LOAD_STORE_SP_FM_MM16<0x32>).
If we change SWSP_MM from ISA_MICROMIPS32_NOT_MIPS32R6 to ISA_MICROMIPS, SWSP_MM could be used for R6 size reduction also.
SWSP_MMR6 looks redundant?

Mar 7 2019, 5:22 AM · Restricted Project
Petar.Avramovic added a comment to D59045: [mips] Fix encoding of the `mov.d` command for microMIPS R6.

FMOV_D64_MM cannot be selected. Maybe you can do the following change instead in file
/lib/Target/Mips/MipsSEInstrInfo.cpp
line 147:

else if (Mips::FGR64RegClass.contains(DestReg, SrcReg))
  Opc = isMicroMips ? Mips::FMOV_D64_MM : Mips::FMOV_D64;
Mar 7 2019, 2:43 AM · Restricted Project

Mar 6 2019

Petar.Avramovic requested review of D58715: [MIPS GlobalISel] Fix mul operands.
Mar 6 2019, 3:20 AM · Restricted Project
Petar.Avramovic updated the diff for D58824: [MIPS GlobalISel] NarrowScalar G_MUL.

Addressed review comments.

Mar 6 2019, 2:47 AM · Restricted Project
Petar.Avramovic updated the diff for D58715: [MIPS GlobalISel] Fix mul operands.

selectImpl in some cases deletes I (using eraseFromParent()) and creates new instruction that is inserted in place of I in machine basic block.
In such cases I.getOpcode() accesses memory that was freed and can return unpredictable value.
For that reason we now select G_MUL manually before call to selectImpl.

Mar 6 2019, 1:44 AM · Restricted Project
Petar.Avramovic reopened D58715: [MIPS GlobalISel] Fix mul operands.

Reverted in https://reviews.llvm.org/rL355219
since it causes failure on bot that tests clang built with address sanitizer.

Mar 6 2019, 1:33 AM · Restricted Project

Mar 1 2019

Petar.Avramovic planned changes to D58826: [MIPS GlobalISel] NarrowScalar G_SMULH.

We need to wait for NarrowScalar of G_SEXT and G_ZEXT and for perfecting artifact legalization
(since here it depends in which order we attempt to combine artifacts that are chained).

Mar 1 2019, 6:31 AM
Petar.Avramovic added a parent revision for D58825: [MIPS GlobalISel] NarrowScalar G_UMULH: D58824: [MIPS GlobalISel] NarrowScalar G_MUL.
Mar 1 2019, 6:31 AM · Restricted Project
Petar.Avramovic added a parent revision for D58826: [MIPS GlobalISel] NarrowScalar G_SMULH: D58825: [MIPS GlobalISel] NarrowScalar G_UMULH.
Mar 1 2019, 6:31 AM
Petar.Avramovic added a child revision for D58825: [MIPS GlobalISel] NarrowScalar G_UMULH: D58826: [MIPS GlobalISel] NarrowScalar G_SMULH.
Mar 1 2019, 6:31 AM · Restricted Project
Petar.Avramovic added a child revision for D58824: [MIPS GlobalISel] NarrowScalar G_MUL: D58825: [MIPS GlobalISel] NarrowScalar G_UMULH.
Mar 1 2019, 6:31 AM · Restricted Project
Petar.Avramovic created D58826: [MIPS GlobalISel] NarrowScalar G_SMULH.
Mar 1 2019, 6:28 AM
Petar.Avramovic created D58825: [MIPS GlobalISel] NarrowScalar G_UMULH.
Mar 1 2019, 6:28 AM · Restricted Project
Petar.Avramovic created D58824: [MIPS GlobalISel] NarrowScalar G_MUL.
Mar 1 2019, 6:28 AM · Restricted Project

Feb 28 2019

Petar.Avramovic committed rG9bf43b5c261b: [MIPS GlobalISel] Fix mul operands (authored by Petar.Avramovic).
[MIPS GlobalISel] Fix mul operands
Feb 28 2019, 11:35 PM
Petar.Avramovic committed rL355178: [MIPS GlobalISel] Fix mul operands.
[MIPS GlobalISel] Fix mul operands
Feb 28 2019, 11:35 PM
Petar.Avramovic closed D58715: [MIPS GlobalISel] Fix mul operands.
Feb 28 2019, 11:35 PM · Restricted Project
Petar.Avramovic committed rGa48285a1900e: [MIPS GlobalISel] Select G_UMULH (authored by Petar.Avramovic).
[MIPS GlobalISel] Select G_UMULH
Feb 28 2019, 11:26 PM
Petar.Avramovic committed rL355177: [MIPS GlobalISel] Select G_UMULH.
[MIPS GlobalISel] Select G_UMULH
Feb 28 2019, 11:26 PM
Petar.Avramovic closed D58714: [MIPS GlobalISel] Select G_UMULH.
Feb 28 2019, 11:26 PM · Restricted Project

Feb 27 2019

Petar.Avramovic added a child revision for D58714: [MIPS GlobalISel] Select G_UMULH: D58715: [MIPS GlobalISel] Fix mul operands.
Feb 27 2019, 6:35 AM · Restricted Project
Petar.Avramovic added a parent revision for D58715: [MIPS GlobalISel] Fix mul operands: D58714: [MIPS GlobalISel] Select G_UMULH.
Feb 27 2019, 6:35 AM · Restricted Project
Petar.Avramovic created D58715: [MIPS GlobalISel] Fix mul operands.
Feb 27 2019, 6:35 AM · Restricted Project
Petar.Avramovic created D58714: [MIPS GlobalISel] Select G_UMULH.
Feb 27 2019, 6:35 AM · Restricted Project

Feb 26 2019

Petar.Avramovic committed rGbd3956991332: [MIPS GlobalISel] Select G_UADDO (authored by Petar.Avramovic).
[MIPS GlobalISel] Select G_UADDO
Feb 26 2019, 9:23 AM
Petar.Avramovic committed rL354900: [MIPS GlobalISel] Select G_UADDO.
[MIPS GlobalISel] Select G_UADDO
Feb 26 2019, 9:22 AM
Petar.Avramovic closed D58671: [MIPS GlobalISel] Select G_UADDO .
Feb 26 2019, 9:22 AM · Restricted Project
Petar.Avramovic created D58671: [MIPS GlobalISel] Select G_UADDO .
Feb 26 2019, 6:02 AM · Restricted Project

Feb 20 2019

Petar.Avramovic committed rGdee5846b4a9d: [MIPS MSA] Avoid some DAG combines for vector shifts (authored by Petar.Avramovic).
[MIPS MSA] Avoid some DAG combines for vector shifts
Feb 20 2019, 5:43 AM
Petar.Avramovic committed rL354461: [MIPS MSA] Avoid some DAG combines for vector shifts.
[MIPS MSA] Avoid some DAG combines for vector shifts
Feb 20 2019, 5:42 AM
Petar.Avramovic closed D58225: [MIPS MSA] Avoid some DAG combines for vector shifts.
Feb 20 2019, 5:42 AM · Restricted Project
Petar.Avramovic updated the diff for D58225: [MIPS MSA] Avoid some DAG combines for vector shifts.

Restrict changes to MIPS backend only.
Use shouldFoldShiftPairToMask to avoid all attempts
to combine shifts if operands have vector type.

Feb 20 2019, 5:15 AM · Restricted Project
Petar.Avramovic committed rG9f38f0ed8b43: [MIPS MSA] Add test for vector shift combines (authored by Petar.Avramovic).
[MIPS MSA] Add test for vector shift combines
Feb 20 2019, 4:13 AM