21 Commits

Author SHA1 Message Date
vporpo
7a38445ee2
[SandboxVec][DAG] Register move instr callback (#120146)
This patch implements the move instruction notifier for the DAG.
Whenever an instruction moves the notifier will maintain the DAG.
2024-12-20 23:10:24 -08:00
vporpo
cafb6b99bb
[SandboxVec][DAG] Update MemDGNode chain upon instr deletion (#118921) 2024-12-10 15:10:45 -08:00
vporpo
eeb55d3af6
[SandboxVec][DAG] Update MemDGNode chain upon instr creation (#116896)
The DAG maintains a chain of MemDGNodes that links together all the
nodes that may touch memroy.
Whenever a new instruction gets created we need to make sure that this
chain gets updated. If the new instruction touches memory then its
corresponding MemDGNode should be inserted into the chain.
2024-12-05 20:23:06 -08:00
vporpo
6e4821487f
[SandboxVec][DAG] Register callback for erase instr (#116742)
This patch adds the callback registration logic in the DAG's constructor
and the corresponding deregistration logic in the destructor. It also
implements the code that makes sure that SchedBundle and DGNodes can be
safely destroyed in any order.
2024-11-19 16:20:38 -08:00
vporpo
31a4d2c2eb
[SandboxVec][DAG] Cleanup: Move callback registration from Scheduler to DAG (#116455)
This is a refactoring patch that moves the callback registration for
getting notified about new instructions from the scheduler to the DAG.
This makes sense from a design and testing point of view:
- the DAG should not rely on the scheduler for getting notified
- the notifiers don't need to be public
- it's easier to test the notifiers directly from within the DAG unit
tests
2024-11-18 20:23:10 -08:00
vporpo
1d09925b4a
[SandboxVec][Scheduler] Boilerplate and initial implementation. (#112449)
This patch implements a ready-list-based scheduler that operates on
DependencyGraph.
It is used by the sandbox vectorizer to test the legality of vectorizing
a group of instrs.

SchedBundle is a helper container, containing all DGNodes that
correspond to the instructions that we are attempting to schedule with
trySchedule(Instrs).
2024-10-18 16:18:43 -07:00
vporpo
fc08ad6610
[SandboxVec][DAG] Implement UnscheduledSuccs (#112255)
This patch implements the UnscheduledSuccs counter in DGNode. It counts
the number of unscheduled successors and is used by the scheduler to
determine when a node is ready.
2024-10-14 16:23:22 -07:00
vporpo
e8dd95e97b
[SandboxVec][DAG] Extend DAG (#111908)
This patch implements growing the DAG towards the top or bottom. This
does the necessary dependency checks and adds new mem dependencies.
2024-10-11 08:12:29 -07:00
vporpo
69c0067927
[SandboxVec][DAG] Refactoring: Outline code that looks for mem nodes (#111750) 2024-10-10 13:25:03 -07:00
vporpo
a4916d2005
[SandboxVec][DAG] Refactoring: Move MemPreds from DGNode to MemDGNode (#111897) 2024-10-10 12:42:28 -07:00
vporpo
747d8f3fc9
[SandboxVec][DAG] Implement PredIterator (#111604)
This patch implements an iterator for iterating over both use-def and
mem dependencies of MemDGNodes.
2024-10-10 12:01:56 -07:00
vporpo
04a8bffdf7
[SandboxVec][DAG] Build actual dependencies (#111094)
This patch implements actual dependencies checking using BatchAA. This
adds memory dep edges between MemDGNodes.
2024-10-08 16:18:57 -07:00
vporpo
7b9c6a7c3c
[SandboxVec][DAG][NFC] Move functions from Utils to DependencyGraph (#111031)
This patch moves:
- Utils::isStackSaveOrRestoreIntrinsic()
- Utils::isMemIntrinsic()
- Utils::isMemDepCandidate()

to DGNode because they no longer require LLVM IR access and are used
only by the DAG.
2024-10-03 15:28:08 -07:00
vporpo
fd5e220fa6
[SandboxVec][DAG] MemDGNode for memory-dependency candidate nodes (#109684)
This patch implements the MemDGNode class for DAG nodes that are
candidates
for memory dependencies. These nodes form a chain that is accessible by
`getPrevNode()` and `getNextNode()`.

It also implements a builder class that creates MemDGNode intervals from
Instructions.
2024-10-01 15:40:54 -07:00
vporpo
e22b07e766
[SandboxIR][NFC] Move Function class to a separate file (#110526) 2024-09-30 10:12:47 -07:00
Vasileios Porpodas
2018f4ccf2 Reapply "[SandboxIR][NFC] Delete SandboxIR.h (#110309)"
This reverts commit 8dfeb4ef5d60a5c764f0ce249cc4ec69e012ff93.
2024-09-27 13:18:44 -07:00
Vasileios Porpodas
8dfeb4ef5d Revert "[SandboxIR][NFC] Delete SandboxIR.h (#110309)"
This reverts commit ca47f48a5c9e81ef8b5c4a5b1fbc473ea5d5497c.
2024-09-27 12:53:25 -07:00
vporpo
ca47f48a5c
[SandboxIR][NFC] Delete SandboxIR.h (#110309) 2024-09-27 12:20:08 -07:00
vporpo
8f31ee996a
[SandboxVec][DAG] Implement DGNode::isMem() (#109504)
DGNode::isMem() returns true if the node is a memory dependency
candidate.
2024-09-21 08:09:30 -07:00
vporpo
0c9f7ef527
[SandboxVec][DAG] Implement extend(ArrayRef) (#109493)
This builds the DAG from an ArrayRef of Instructions.
2024-09-20 19:09:00 -07:00
vporpo
318d2f5e5d
[SandboxVec][DAG] Boilerplate (#108862)
This patch adds a very basic implementation of the Dependency Graph to
be used by the vectorizer.
2024-09-17 12:03:52 -07:00