Page MenuHomePhabricator

aditya_nandakumar (Aditya Nandakumar)
User

Projects

User does not belong to any projects.

User Details

User Since
Oct 17 2014, 4:45 PM (441 w, 1 d)

Recent Activity

Mar 2 2023

aditya_nandakumar closed D145006: [GISel][CSE][NFC]: Handle mutual recursion when inserting node.
Mar 2 2023, 2:46 PM · Restricted Project, Restricted Project

Feb 28 2023

aditya_nandakumar requested review of D145006: [GISel][CSE][NFC]: Handle mutual recursion when inserting node.
Feb 28 2023, 2:10 PM · Restricted Project, Restricted Project

Nov 15 2021

aditya_nandakumar added a comment to D98232: [regalloc] Ensure Query::collectInterferringVregs is called before interval iteration.

should we go ahead and revert (most of*) https://reviews.llvm.org/D35816?

Although I think that's the right approach, neither @aditya_nandakumar or I had time to clean up and push the fix for eviction chains yet.

@aditya_nandakumar do you have an ETA when you believe you can land that?

Hi Quentin, unfortunately I've not had the time to upstream this or think about cleaning this up and upstreaming it.

Should I just take over at this point?

If you have the cycles, please go for it. I don't want to hold up progress here. Thanks

Cheers,
-Quenitn

Nov 15 2021, 4:12 PM · Restricted Project, Restricted Project

Jul 28 2021

aditya_nandakumar added a comment to D106881: [WIP][GIlobalSel] Add GISelCSEAnalysisWrapperPass::verifyAnalysis.

Any thoughts on this? I thought it would be cleaner to use the standard analysis verification API instead of ad hoc calls to CSEInfo->verify from the Legalizer and Combiner.

It does appear cleaner once we make sure that all backends are clean wrt reporting all mutations to the observers (last time I checked there were failures and I didn't get a chance to verify and fix). If that's indeed the case, then LGTM.

There are still some AMDGPU lit test failures, because we do some things in the legalizer that are not safe wrt observers.

On the other hand, the AMDGPU legalizer doesn't use CSEMIRBuilder, so is there any need for it to report stuff to the observers?

If CSE is not enabled, then I think the verifier should not complain (CSEs). The main contract is to notify Observers of mutations (technically not necessary if there's nothing observing, but still better to notify).

On the other other hand, the AMDGPU legalizer probably should use CSEMIRBuilder. The main problem I saw last time I tried this was with MRI->setRegClass(Reg, RC). As I understand it, this counts as a mutation of not just the instruction that defines Reg, but every instruction that uses Reg too. Is that correct? Is there a way to report that kind of widespread mutation to the observers?

Yes there is.

if (GISelChangeObserver *Observer = MF.getObserver()) {
  Register Reg = ...;
  Observer->changingAllUsesOfReg(MRI, Reg);
  // change it.
  Observer->finishedChangingAllUsesOfReg();
}
Jul 28 2021, 9:26 AM · Restricted Project

Jul 27 2021

aditya_nandakumar added a comment to D106881: [WIP][GIlobalSel] Add GISelCSEAnalysisWrapperPass::verifyAnalysis.

Any thoughts on this? I thought it would be cleaner to use the standard analysis verification API instead of ad hoc calls to CSEInfo->verify from the Legalizer and Combiner.

Jul 27 2021, 10:15 AM · Restricted Project

Jul 20 2021

aditya_nandakumar committed rGfbd3bb4365e1: [NFC][AssemblyWriter] Allow AssemblyWriter::printBasicBlock() to print blocks… (authored by aditya_nandakumar).
[NFC][AssemblyWriter] Allow AssemblyWriter::printBasicBlock() to print blocks…
Jul 20 2021, 3:47 PM

Jul 15 2021

aditya_nandakumar added inline comments to D105525: [GISel] Add fpext/fptrunc combines.
Jul 15 2021, 1:03 PM · Restricted Project

Jul 10 2021

aditya_nandakumar added a comment to D105751: GlobalISel: Introduce GenericMachineInstr classes and derivatives for idiomatic LLVM RTTI..

I think I like this direction more just because the casting stuff is more consistent with the rest of LLVM. That might be more approachable for people who are more experienced with other parts of LLVM.

Jul 10 2021, 5:19 PM · Restricted Project

Mar 31 2021

aditya_nandakumar added a comment to D98232: [regalloc] Ensure Query::collectInterferringVregs is called before interval iteration.

@aditya_nandakumar @qcolombet any idea when a better fix for that issue might be available?

Given Aditya did the prototype I let him comment on that, but I don't expect we land something anytime soon (i.e., at least a couple of months).

Mar 31 2021, 10:02 AM · Restricted Project, Restricted Project

Feb 5 2021

aditya_nandakumar accepted D96122: [GlobalISel] Start using vectors in GISelKnownBits.
Feb 5 2021, 9:18 AM · Restricted Project

Dec 16 2020

aditya_nandakumar added a comment to D93423: [GlobalISel] Use slot indexes to speed up huge block compile time.

If slot indexes are preserved and used in other passes that use CSE, do you think the compile time impact is amortized/minimized?

It's possible it would help a bit. I think the localizer may also benefit from this. I don't see it making a big difference either way though in most code.

Dec 16 2020, 3:49 PM · Restricted Project
aditya_nandakumar added a comment to D93423: [GlobalISel] Use slot indexes to speed up huge block compile time.

If slot indexes are preserved and used in other passes that use CSE, do you think the compile time impact is amortized/minimized?

Dec 16 2020, 3:39 PM · Restricted Project
aditya_nandakumar added a comment to D93423: [GlobalISel] Use slot indexes to speed up huge block compile time.

I still think the CSE MIR builder shouldn't be required to CSE and can bail early on long dominance queries

Dec 16 2020, 3:37 PM · Restricted Project

Oct 28 2020

aditya_nandakumar closed D88060: [GISel]: Few InsertVecElt combines.

rGbed839404784

Oct 28 2020, 12:29 PM · Restricted Project
aditya_nandakumar committed rGbed839404784: [GISel]: Few InsertVecElt combines (authored by aditya_nandakumar).
[GISel]: Few InsertVecElt combines
Oct 28 2020, 12:29 PM

Oct 22 2020

aditya_nandakumar added inline comments to D88060: [GISel]: Few InsertVecElt combines.
Oct 22 2020, 1:53 PM · Restricted Project
aditya_nandakumar updated the diff for D88060: [GISel]: Few InsertVecElt combines.

Updates as requested.

Oct 22 2020, 1:51 PM · Restricted Project

Oct 15 2020

aditya_nandakumar added inline comments to D88060: [GISel]: Few InsertVecElt combines.
Oct 15 2020, 10:56 AM · Restricted Project

Oct 14 2020

aditya_nandakumar added inline comments to D88060: [GISel]: Few InsertVecElt combines.
Oct 14 2020, 2:24 PM · Restricted Project
aditya_nandakumar added a comment to D89392: [GlobalISel] Fold unary opcodes in CSEMIRBuilder.

I attempted this in the past but abandoned it due to infinite loops in legalization like mentioned earlier. Constant folding during legalization seems okay as long as it operates on legal types (ie fold an operation of constants (which are already legal) to the same type.

Oct 14 2020, 10:49 AM · Restricted Project
aditya_nandakumar updated the diff for D88060: [GISel]: Few InsertVecElt combines.

Address Jay's comments.

Oct 14 2020, 10:43 AM · Restricted Project
aditya_nandakumar added a comment to D88060: [GISel]: Few InsertVecElt combines.

Reverse ping! If you just don't have time to work on this, I'd be interested in commandeering the "insert_vec_elt(build_vector) -> build_vector" part.

Oct 14 2020, 10:36 AM · Restricted Project

Oct 13 2020

aditya_nandakumar closed D88865: [GISel] Add combine for constant G_PTR_ADD offsets..

Committed in ef3d17482ff

Oct 13 2020, 5:27 PM · Restricted Project
aditya_nandakumar committed rGef3d17482fff: [GISel] Add combine for constant G_PTR_ADD offsets. (authored by aditya_nandakumar).
[GISel] Add combine for constant G_PTR_ADD offsets.
Oct 13 2020, 5:26 PM

Sep 29 2020

aditya_nandakumar updated the diff for D88060: [GISel]: Few InsertVecElt combines.

Address latest comments by Matt

Sep 29 2020, 10:54 AM · Restricted Project

Sep 23 2020

aditya_nandakumar updated the diff for D88060: [GISel]: Few InsertVecElt combines.

Also missed some unstaged changes locally
s/push_back/emplace_back

Sep 23 2020, 6:24 PM · Restricted Project
aditya_nandakumar updated the diff for D88060: [GISel]: Few InsertVecElt combines.

s/std::sort/llvm::sort

Sep 23 2020, 6:21 PM · Restricted Project
aditya_nandakumar updated the diff for D88060: [GISel]: Few InsertVecElt combines.

Insert undef during the apply phase instead of the match as mentioned in the feedback.

Sep 23 2020, 6:19 PM · Restricted Project
aditya_nandakumar added inline comments to D88060: [GISel]: Few InsertVecElt combines.
Sep 23 2020, 6:18 PM · Restricted Project
aditya_nandakumar added inline comments to D88060: [GISel]: Few InsertVecElt combines.
Sep 23 2020, 3:21 PM · Restricted Project
aditya_nandakumar updated the diff for D88060: [GISel]: Few InsertVecElt combines.

Updated to handle the missing index as well duplicate indices cases.

Sep 23 2020, 1:55 PM · Restricted Project
aditya_nandakumar added inline comments to D88060: [GISel]: Few InsertVecElt combines.
Sep 23 2020, 9:54 AM · Restricted Project

Sep 22 2020

aditya_nandakumar updated the diff for D88060: [GISel]: Few InsertVecElt combines.

Updated to abandon combine if index is out of bounds.

Sep 22 2020, 6:31 PM · Restricted Project
aditya_nandakumar added inline comments to D88060: [GISel]: Few InsertVecElt combines.
Sep 22 2020, 6:30 PM · Restricted Project
aditya_nandakumar added inline comments to D88060: [GISel]: Few InsertVecElt combines.
Sep 22 2020, 4:08 PM · Restricted Project

Sep 21 2020

aditya_nandakumar requested review of D88060: [GISel]: Few InsertVecElt combines.
Sep 21 2020, 5:43 PM · Restricted Project

Sep 15 2020

aditya_nandakumar committed rG97203cfd6bae: [GISel] Add new GISel combiners for G_MUL (authored by aditya_nandakumar).
[GISel] Add new GISel combiners for G_MUL
Sep 15 2020, 4:15 PM
aditya_nandakumar closed D87668: [GISel] Add new GISel combiners for G_MUL.

Pushed in 97203cfd6ba

Sep 15 2020, 4:15 PM · Restricted Project
aditya_nandakumar added a comment to D87668: [GISel] Add new GISel combiners for G_MUL.

Thanks for the review. Still don't have commit access, will need someone to commit on my behalf. Thanks in advance!

Sep 15 2020, 2:30 PM · Restricted Project

Sep 14 2020

aditya_nandakumar closed D87554: [GISel]: Add combine for G_FABS to G_FABS.

Committed in 46f9137e43f

Sep 14 2020, 3:57 PM · Restricted Project
aditya_nandakumar committed rG46f9137e43f3: [GISel]: Add combine for G_FABS to G_FABS (authored by aditya_nandakumar).
[GISel]: Add combine for G_FABS to G_FABS
Sep 14 2020, 3:56 PM
aditya_nandakumar added a comment to D87554: [GISel]: Add combine for G_FABS to G_FABS.

I can commit on your behalf.
Also we'll need to figure out how to get you access.

Sep 14 2020, 3:11 PM · Restricted Project
aditya_nandakumar added inline comments to D87297: [GlobalISel] Add bailout thresholds to CSEMIRBuilder::dominates() and the localizer..
Sep 14 2020, 11:14 AM · Restricted Project

Sep 10 2020

aditya_nandakumar added inline comments to D87297: [GlobalISel] Add bailout thresholds to CSEMIRBuilder::dominates() and the localizer..
Sep 10 2020, 10:51 PM · Restricted Project

Sep 9 2020

aditya_nandakumar added inline comments to D87297: [GlobalISel] Add bailout thresholds to CSEMIRBuilder::dominates() and the localizer..
Sep 9 2020, 6:35 PM · Restricted Project
aditya_nandakumar added a comment to D87297: [GlobalISel] Add bailout thresholds to CSEMIRBuilder::dominates() and the localizer..

Hi Amara,

dominates(A, B) tries to determine dominance by walking an iterator from the beginning of the block potentially until the end. In extremely large BBs this can result in very long compile times, since this is called often from the artifact combiner.

Instead of disabling the check, I think it would be best to fix the underlying compile time issue. The solution here would be to switch the list of MachineInstr to numbered instructions so that dominance checks become O(1).
I had meant to look at this for quite some time but didn't get a chance to do it.
Something similar has been done on LLVM IR (see https://reviews.llvm.org/D51664). I wish it was done in a way that could have benefited the Machine IR like I suggested in https://reviews.llvm.org/D51664#1389884, but this ship has sailed!

I understand this is a big under taking so I am fine with the threshold approach in the meantime.

I leave the final approval to Aditya and Matt.

Cheers,
-Quentin

Yes I saw that thread, it's a shame we didn't have a shared solution for MBB too. There's probably more places where we have hidden super-linear compile time waiting to be triggered.

It's actually not quite as simple as I previously thought. The current logic in getDominatingInstrForID seems to be this:

MachineInstr *A = CSE_lookup_in_same_bb(B)
if (!dominates(A, B))
    move A before B such that dominates(A, B) is true
else
    return pointer to A

If we hit our threshold, what should getDominatingInstrForID() do? Perhaps clone the instruction A instead?

Sep 9 2020, 6:28 PM · Restricted Project

Sep 8 2020

aditya_nandakumar added inline comments to D87297: [GlobalISel] Add bailout thresholds to CSEMIRBuilder::dominates() and the localizer..
Sep 8 2020, 3:16 PM · Restricted Project
aditya_nandakumar added inline comments to D87297: [GlobalISel] Add bailout thresholds to CSEMIRBuilder::dominates() and the localizer..
Sep 8 2020, 1:53 PM · Restricted Project

Sep 1 2020

aditya_nandakumar added a comment to D86226: GlobalISel: Do not set observer of MachineIRBuilder in LegalizerHelper.

My thought on this Observer ownership is as follows (which I think I mentioned in another review).

  • Each pass will setup an observer(wrapper) and install it to the MF. The MF at this point has the reference to the observer, and the pass owns each observer as it decides what it needs to observe and how.
  • At the end of each pass, just reset the observer (there are RAII helpers for this).
  • Remove the observer in MachineIRBuilder (is there a need for this?).
  • No need to thread observer through APIs. Instead we get it through MF.getObserver().

Thoughts?

I'm mostly concerned with the wonky way we set register banks on new instructions with an observer. This isn't pass / function level, and is on an individual instruction we're legalizing.

Sep 1 2020, 11:36 AM · Restricted Project
aditya_nandakumar added a comment to D86226: GlobalISel: Do not set observer of MachineIRBuilder in LegalizerHelper.

My thought on this Observer ownership is as follows (which I think I mentioned in another review).

  • Each pass will setup an observer(wrapper) and install it to the MF. The MF at this point has the reference to the observer, and the pass owns each observer as it decides what it needs to observe and how.
  • At the end of each pass, just reset the observer (there are RAII helpers for this).
  • Remove the observer in MachineIRBuilder (is there a need for this?).
  • No need to thread observer through APIs. Instead we get it through MF.getObserver().
Sep 1 2020, 10:26 AM · Restricted Project

Aug 27 2020

aditya_nandakumar added a comment to D83833: [GISel] Add new GISel combiners for G_SELECT.

rGdb464a3dbf0e

Aug 27 2020, 9:49 AM · Restricted Project
aditya_nandakumar closed D83833: [GISel] Add new GISel combiners for G_SELECT.

rGdb464a3dbf0e

Aug 27 2020, 9:49 AM · Restricted Project
aditya_nandakumar committed rGdb464a3dbf0e: [GISel] Add new GISel combiners for G_SELECT (authored by aditya_nandakumar).
[GISel] Add new GISel combiners for G_SELECT
Aug 27 2020, 9:48 AM
aditya_nandakumar closed D86676: [GISel]: Fix one more CSE Non determinism.

rG5c2db1655

Aug 27 2020, 9:11 AM · Restricted Project
aditya_nandakumar committed rG5c2db1655b2a: [GISel]: Fix one more CSE Non determinism (authored by aditya_nandakumar).
[GISel]: Fix one more CSE Non determinism
Aug 27 2020, 9:07 AM
aditya_nandakumar added a comment to D83833: [GISel] Add new GISel combiners for G_SELECT.

I can commit for you if no one has gotten to it yet.

Aug 27 2020, 8:56 AM · Restricted Project

Aug 26 2020

aditya_nandakumar requested review of D86676: [GISel]: Fix one more CSE Non determinism.
Aug 26 2020, 9:49 PM · Restricted Project

Aug 24 2020

aditya_nandakumar added a comment to D86468: [WIP][GlobalISel] CSE copies.

It's a fine balance in how much the builders should do compared to DAG. I also personally found SDAG's getNode to be doing too much (and some of that code was replicated in the DAGCombines).
CSEMIRBuilder builds on the other builders by adding CSE. ConstantFoldingBuilder was POC on how to extend/customize builders. While I'm not sure where the balance on how much the builders should do, assuming we wanted to fold copies, it should be structured to be in one of the base builders (as the change seems unrelated to CSEing in general).

Aug 24 2020, 11:54 AM · Restricted Project

Jul 31 2020

aditya_nandakumar added a comment to D84909: [GISel] Add combiners for G_INTTOPTR and G_PTRTOINT.

Committed in 2144a3bdbba4

Jul 31 2020, 10:25 AM · Restricted Project
aditya_nandakumar committed rG2144a3bdbba4: [GISel] Add combiners for G_INTTOPTR and G_PTRTOINT (authored by aditya_nandakumar).
[GISel] Add combiners for G_INTTOPTR and G_PTRTOINT
Jul 31 2020, 10:14 AM

Jul 30 2020

aditya_nandakumar added a comment to D84909: [GISel] Add combiners for G_INTTOPTR and G_PTRTOINT.

I can commit it for you.

Jul 30 2020, 9:00 PM · Restricted Project

Jul 29 2020

aditya_nandakumar accepted D84881: GlobalISel: Fix insert point in CSEMIRBuilder unit test.

Silly bug. Thanks for fixing.

Jul 29 2020, 11:44 AM · Restricted Project

Jul 17 2020

aditya_nandakumar closed D84072: [GISel: Add support for CSEing SrcOps which are immediates.
Jul 17 2020, 4:12 PM · Restricted Project
aditya_nandakumar committed rG63c081e73d3d: [GISel: Add support for CSEing SrcOps which are immediates (authored by aditya_nandakumar).
[GISel: Add support for CSEing SrcOps which are immediates
Jul 17 2020, 4:10 PM
aditya_nandakumar updated the diff for D84072: [GISel: Add support for CSEing SrcOps which are immediates.

Add G_EXTRACT to CSEConfigFull, and add unit test.

Jul 17 2020, 3:35 PM · Restricted Project
Herald added a project to D84072: [GISel: Add support for CSEing SrcOps which are immediates: Restricted Project.
Jul 17 2020, 3:06 PM · Restricted Project

Jul 7 2020

aditya_nandakumar added inline comments to D81901: GlobalISel: Implement bitcast action for G_EXTRACT_VECTOR_ELEMENT.
Jul 7 2020, 4:25 PM · Restricted Project

Jun 18 2020

aditya_nandakumar added inline comments to D81899: [gicombiner] Unify common state for current targets into CommonTargetCombinerHelperState.
Jun 18 2020, 2:46 PM · Restricted Project, Restricted Project

Jun 16 2020

aditya_nandakumar accepted D81889: [gicombiner] Allow disable-rule option to disable all-except-....

This looks much better. Looks good to me.

Jun 16 2020, 5:01 PM · Restricted Project
aditya_nandakumar added a comment to D81889: [gicombiner] Allow disable-rule option to disable all-except-....

To enable rules {x,y}, you'd need to disable the universe, and specify rules you want to enable with !, all in a command called disable-rule*. This sounds inverse of what's necessary and is far from ergonomic.
I see this as similar to if opt/llc run-pass invocation was done by disable universe of passes, and enable some passes with !.
Additionally for the most common and immediately useful case of writing tests, I don't expect any need to both enable and disable rules in the same invocation. IOW, for testing purposes, only use the enable opt, and for bisecting and other tools (for future), use the disable opt. Perhaps we should rename the opt to make it explicit that it's used for testing only and perhaps even we assert that both are not used simultaneously (or make it abundantly clear in the docs).
TLDR; I'm suggesting we optimize the interface for the most common and immediately useful case of testing, and worry about enabling and disabling simultaneously later on?

Jun 16 2020, 3:56 PM · Restricted Project
aditya_nandakumar added a comment to D81889: [gicombiner] Allow disable-rule option to disable all-except-....

The point here is to allow people to only enable specific rules, right?

Maybe an interface like this would be a bit simpler?

--my_combiner-only-enable-rules="rule1,rule2,rule3,..."

Jun 16 2020, 3:23 PM · Restricted Project
aditya_nandakumar added inline comments to D81899: [gicombiner] Unify common state for current targets into CommonTargetCombinerHelperState.
Jun 16 2020, 11:32 AM · Restricted Project, Restricted Project
aditya_nandakumar accepted D81862: [gicombiner] Allow generated CombinerHelpers to have additional arguments.
Jun 16 2020, 11:00 AM · Restricted Project

Jun 15 2020

aditya_nandakumar accepted D81377: GlobalISel: Add a note to G_BITCAST documentation.
Jun 15 2020, 2:54 PM · Restricted Project
aditya_nandakumar added a comment to D81862: [gicombiner] Allow generated CombinerHelpers to have additional arguments.

Doesn't https://reviews.llvm.org/D81863 make this unnecessary?

Jun 15 2020, 2:54 PM · Restricted Project
aditya_nandakumar added inline comments to D81863: [gicombiner] Allow generated combiners to store additional members.
Jun 15 2020, 2:54 PM · Restricted Project

Jun 11 2020

aditya_nandakumar closed D81625: [GISel][NFC]: Add unit test for clarifying CSE behavior.

rG6239d6700184

Jun 11 2020, 1:47 PM · Restricted Project
aditya_nandakumar committed rG6239d6700184: [GISel][NFC]: Add unit test for clarifying CSE behavior (authored by aditya_nandakumar).
[GISel][NFC]: Add unit test for clarifying CSE behavior
Jun 11 2020, 1:15 PM

Jun 10 2020

aditya_nandakumar created D81625: [GISel][NFC]: Add unit test for clarifying CSE behavior.
Jun 10 2020, 6:20 PM · Restricted Project
aditya_nandakumar added a comment to D81461: GlobalISel: Fix double printing new instructions in legalizer.

Is there any interest in me checking in the above unit test? I initially didn't check it in as I thought this was more of a side effect of how things are implemented and not really how the APIs should be used.

Jun 10 2020, 4:08 PM · Restricted Project
aditya_nandakumar accepted D81510: GlobalISel: Pass LegalizerHelper to custom legalize callbacks.
Jun 10 2020, 9:59 AM · Restricted Project

Jun 9 2020

aditya_nandakumar added a comment to D81461: GlobalISel: Fix double printing new instructions in legalizer.

It seems both the MachineFunction and MachineIRBuilder have insertion observers; this seems redundant. I think the machine function observers should be removed?

MachineFunction observers are useful even if instructions are built without MIRBuilders (say using BuildMI) so CSE can be aware of it. Similar for deletions. To me, since the MF observer is always called, the one in MachineIRBuilder seems redundant.

I don't think I would expect CSE or any magic when using BuildMI or generally touching the function. I think anything before selection should be going through MachineIRBuilder?

I also don't see how CSE would work with BuildMI, since you don't see the full set of operands at construction as CSE requires. Even with MachineIRBuilder, you only get CSE if you construct the instruction with all of its operands initially. Trying to handle this for target instructions also generally starts to break down with implicit operands etc.

Jun 9 2020, 11:32 AM · Restricted Project
aditya_nandakumar accepted D81461: GlobalISel: Fix double printing new instructions in legalizer.
Jun 9 2020, 10:57 AM · Restricted Project
aditya_nandakumar added a comment to D81461: GlobalISel: Fix double printing new instructions in legalizer.

LGTM

I'm not sure this is the correct instance to remove; now the visible
ordering is different. Now you will typically see the one erased
instruction message before all the new instructions in order. I think
this is the more logical view of typical legalization changes,
although it's mechanically backwards from the normal
insert-new-erase-old pattern.

Another reason for keeping the one in printNewInstrs() is that createInstr() sees the MI before its populated with operands. I think it's more useful to keep the one that's the fully built instruction

Actually I think this isn't the main source of double printing. The same observer seems to get called twice:
...

Was that with the same MI pointer? I assume it is but the dump doesn't make it clear

I think this is with the same MI pointer.

It seems both the MachineFunction and MachineIRBuilder have insertion observers; this seems redundant. I think the machine function observers should be removed?

MachineFunction observers are useful even if instructions are built without MIRBuilders (say using BuildMI) so CSE can be aware of it. Similar for deletions. To me, since the MF observer is always called, the one in MachineIRBuilder seems redundant.

I'd lean towards the MachineFunction ones too although admittedly I haven't dug into the details there

Jun 9 2020, 10:57 AM · Restricted Project
aditya_nandakumar added a comment to D81461: GlobalISel: Fix double printing new instructions in legalizer.

It seems both the MachineFunction and MachineIRBuilder have insertion observers; this seems redundant. I think the machine function observers should be removed?

Jun 9 2020, 9:19 AM · Restricted Project

Jun 8 2020

aditya_nandakumar added a comment to D81381: GlobalISel: Move some trivial MIRBuilder methods into the header.

The construction APIs for MachineIRBuilder don't make much sense,

What exactly do you mean by this? I agree with the latter about these trivial methods getting in the way.

See D81382. I also think it's a problem that RegBankSelect and other backend users need to construct their own single purpose builders, when the builder is supposed to be maintaining CSE state for example

Jun 8 2020, 2:25 PM · Restricted Project
aditya_nandakumar accepted D81382: GlobalISel: Improve MachineIRBuilder construction.
Jun 8 2020, 11:36 AM · Restricted Project
aditya_nandakumar accepted D81381: GlobalISel: Move some trivial MIRBuilder methods into the header.

The construction APIs for MachineIRBuilder don't make much sense,

What exactly do you mean by this? I agree with the latter about these trivial methods getting in the way.

Jun 8 2020, 11:35 AM · Restricted Project
aditya_nandakumar accepted D81387: GlobalISel: Set instr/debugloc before any legalizer action.

Looks good.

Jun 8 2020, 11:35 AM · debug-info, Restricted Project

Apr 22 2020

aditya_nandakumar committed rG3db893b3712a: [GISel]: Relax opcode checking at the top level to enable CSE (authored by aditya_nandakumar).
[GISel]: Relax opcode checking at the top level to enable CSE
Apr 22 2020, 5:59 PM
aditya_nandakumar closed D78684: [GISel]: Relax opcode checking at the top level to enable CSE.
Apr 22 2020, 5:59 PM · Restricted Project
aditya_nandakumar created D78684: [GISel]: Relax opcode checking at the top level to enable CSE.
Apr 22 2020, 3:48 PM · Restricted Project

Apr 17 2020

aditya_nandakumar accepted D78388: [globalisel][cse] Merge debug locations when CSE'ing.
Apr 17 2020, 11:53 AM · Restricted Project

Apr 12 2020

aditya_nandakumar accepted D77966: [llvm][MIRVRegNamer] Avoid collisions across jump table indices..

I'm beginning to wonder if maybe it makes sense to put all of these individual tests, in one place instead of being scattered across many tests (considering they're all testing the same thing) so it's easier to find.
Not related to this, but this patch LTGM.

Apr 12 2020, 7:14 PM · Restricted Project

Feb 18 2020

aditya_nandakumar closed D67133: [GlobalISel]: Fix some non determinism exposed in CSE due to not notifying observers about mutations + add verification for CSE.

Committed in b91d9ec0bb8

Feb 18 2020, 3:02 PM · Restricted Project
aditya_nandakumar committed rGb91d9ec0bb8c: [GlobalISel]: Fix some non determinism exposed in CSE due to not notifying… (authored by aditya_nandakumar).
[GlobalISel]: Fix some non determinism exposed in CSE due to not notifying…
Feb 18 2020, 2:56 PM
aditya_nandakumar added a comment to D67133: [GlobalISel]: Fix some non determinism exposed in CSE due to not notifying observers about mutations + add verification for CSE.

I'll go ahead and get this in (as it already received a LGTM before) - just posted an updated patch since it's been a while since received updates.

Feb 18 2020, 2:44 PM · Restricted Project
aditya_nandakumar updated the diff for D67133: [GlobalISel]: Fix some non determinism exposed in CSE due to not notifying observers about mutations + add verification for CSE.

Updated based on feedback.
CSEInfo::verify now returns Error which we can assert.

Feb 18 2020, 2:43 PM · Restricted Project

Feb 13 2020

aditya_nandakumar accepted D74575: GlobalISel: Don't use LLT references.
Feb 13 2020, 12:05 PM · Restricted Project

Feb 11 2020

aditya_nandakumar accepted D74449: [llvm][MIR-Canon] Adding support for avoiding collisions across constant pool indices..
Feb 11 2020, 11:12 PM · Restricted Project