Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# 79cbad18 29-Jan-2025 vporpo <vporpodas@google.com>

[SandboxVec] Clear Context's state within runOnFunction() (#124842)

`sandboxir::Context` is defined at a pass-level scope with the
`SandboxVectorizerPass` class because the function pass manager `F

[SandboxVec] Clear Context's state within runOnFunction() (#124842)

`sandboxir::Context` is defined at a pass-level scope with the
`SandboxVectorizerPass` class because the function pass manager `FPM`
object depends on it, and that is in pass-level scope to avoid
recreating the pass pipeline every single time `runOnFunction()` is
called.

This means that the Context's state lives on across function passes. The
problem is twofold:
(i) the LLVM IR to Sandbox IR map can grow very large including objects
from different functions, which is of no use to the vectorizer, as it's
a function-level pass.
(ii) this can result in stale data in the LLVM IR to Sandbox IR object
map, as other passes may delete LLVM IR objects.

To fix both issues this patch introduces a `Context::clear()` function
that clears the `LLVMValueToValueMap`.

show more ...


# 334a1cdb 28-Jan-2025 vporpo <vporpodas@google.com>

[SandboxIR] createFunction() should always create a function (#124665)

This patch removes the assertion that checks for an existing function.
If one exists it will remove it and create a new one. T

[SandboxIR] createFunction() should always create a function (#124665)

This patch removes the assertion that checks for an existing function.
If one exists it will remove it and create a new one. This helps remove
a crash when a function declaration object already exists and we are
about to create a SandboxIR object for the definition.

show more ...


Revision tags: llvmorg-19.1.7
# 6312beef 09-Jan-2025 vporpo <vporpodas@google.com>

[SandboxVec][BottomUpVec] Use SeedCollector and slice seeds (#120826)

With this patch we switch from the temporary dummy seeds to actual seeds
provided by the seed collector.
The seeds get sliced

[SandboxVec][BottomUpVec] Use SeedCollector and slice seeds (#120826)

With this patch we switch from the temporary dummy seeds to actual seeds
provided by the seed collector.
The seeds get sliced and each slice is used as the starting point for
vectorization.

show more ...


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4
# 5942a99f 06-Nov-2024 vporpo <vporpodas@google.com>

[SandboxVec] Notify scheduler about new instructions (#115102)

This patch registers the "createInstr" callback that notifies the
scheduler about newly created instructions. This guarantees that all

[SandboxVec] Notify scheduler about new instructions (#115102)

This patch registers the "createInstr" callback that notifies the
scheduler about newly created instructions. This guarantees that all
newly created instructions have a corresponding DAG node associated with
them. Without this the pass crashes when the scheduler encounters the
newly created vector instructions.

This patch also changes the lifetime of the sandboxir Ctx variable in
the SandboxVectorizer pass. It needs to be destroyed after the passes
get destroyed. Without this change when components like the Scheduler
get destroyed Ctx will have already been freed, which is not legal.

show more ...


# ce0d0858 05-Nov-2024 vporpo <vporpodas@google.com>

[SandboxVec][Legality] Query the scheduler for legality (#114616)

This patch adds the legality check of whether the candidate instructions
can be scheduled together. This uses a Scheduler object.


Revision tags: llvmorg-19.1.3
# a461869d 29-Oct-2024 vporpo <vporpodas@google.com>

[SandboxIR][Pass] Implement Analyses class (#113962)

The Analyses class provides a way to pass around commonly used Analyses
to SandboxIR passes throught `runOnFunction()` and `runOnRegion()`
func

[SandboxIR][Pass] Implement Analyses class (#113962)

The Analyses class provides a way to pass around commonly used Analyses
to SandboxIR passes throught `runOnFunction()` and `runOnRegion()`
functions.

show more ...


# 2e8ad49e 15-Oct-2024 Jorge Gorbe Moya <jgorbe@google.com>

[SandboxVec] Add pass to create Regions from metadata. Generalize SandboxVec pass pipelines. (#112288)

My previous attempt (#111904) hacked creation of Regions from metadata
into the bottom-up vect

[SandboxVec] Add pass to create Regions from metadata. Generalize SandboxVec pass pipelines. (#112288)

My previous attempt (#111904) hacked creation of Regions from metadata
into the bottom-up vectorizer. I got some feedback that it should be its
own pass. So now we have two SandboxIR function passes (`BottomUpVec`
and `RegionsFromMetadata`) that are interchangeable, and we could have
other SandboxIR function passes doing other kinds of transforms, so this
commit revamps pipeline creation and parsing.

First, `sandboxir::PassManager::setPassPipeline` now accepts pass
arguments in angle brackets. Pass arguments are arbitrary strings that
must be parsed by each pass, the only requirement is that nested angle
bracket pairs must be balanced, to allow for nested pipelines with more
arguments. For example:
```
bottom-up-vec<region-pass-1,region-pass-2<arg>,region-pass-3>
```
This has complicated the parser a little bit (the loop over pipeline
characters now contains a small state machine), and we now have some new
test cases to exercise the new features.

The main SandboxVectorizerPass now contains a customizable pipeline of
SandboxIR function passes, defined by the `sbvec-passes` flag. Region
passes for the bottom-up vectorizer pass are now in pass arguments (like
in the example above).

Because we have now several classes that can build sub-pass pipelines,
I've moved the logic that interacts with PassRegistry.def into its own
files (PassBuilder.{h,cpp} so it can be easily reused.

Finally, I've added a `RegionsFromMetadata` function pass, which will
allow us to run region passes in isolation from lit tests without
relying on the bottom-up vectorizer, and a new lit test that does
exactly this.

Note that the new pipeline parser now allows empty pipelines. This is
useful for testing. For example, if we use
```
-sbvec-passes="bottom-up-vec<>"
```
SandboxVectorizer converts LLVM IR to SandboxIR and runs the bottom-up
vectorizer, but no region passes afterwards.
```
-sbvec-passes=""
```
SandboxVectorizer converts LLVM IR to SandboxIR and runs no passes on
it. This is useful to exercise SandboxIR conversion on its own.

show more ...


Revision tags: llvmorg-19.1.2
# 756ec99c 10-Oct-2024 Jorge Gorbe Moya <jgorbe@google.com>

[SandboxVec] Re-land "Use sbvec-passes flag to create a pipeline of Region passes after BottomUpVec. (#111223)" (#111772)

https://github.com/llvm/llvm-project/pull/111223 was reverted because of
a

[SandboxVec] Re-land "Use sbvec-passes flag to create a pipeline of Region passes after BottomUpVec. (#111223)" (#111772)

https://github.com/llvm/llvm-project/pull/111223 was reverted because of
a build failure with `-DBUILD_SHARED_LIBS=on`.

The Passes component depends on Vectorizer (because PassBuilder needs to
be able to instantiate SandboxVectorizerPass). This resulted in CMake
doing this

1. when it builds lib/libLLVMVectorize.so.20.0git it adds
lib/libLLVMSandboxIR.so.20.0git to the command line, because it's listed
as a dependency (as expected)
2. when it's trying to build lib/libLLVMPasses.so.20.0git it adds
lib/libLLVMVectorize.so.20.0git to the command line, because it's listed
as a dependency (also as expected). But not libLLVMSandboxIR.so.

When SandboxVectorizerPass has its ctors/dtors defined inline, this
caused "undefined reference to vtable" linker errors. This change works
around that by moving ctors/dtors out of line.

Also fix a bazel build problem by adding the new
`llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/PassRegistry.def`
as a textual header in the Vectorizer target.

show more ...


# 102c384b 09-Oct-2024 Jorge Gorbe Moya <jgorbe@google.com>

Revert "[SandboxVectorizer] Use sbvec-passes flag to create a pipeline of Region passes after BottomUpVec." (#111727)

Reverts llvm/llvm-project#111223

It broke one of the build bots:

LLVM Buil

Revert "[SandboxVectorizer] Use sbvec-passes flag to create a pipeline of Region passes after BottomUpVec." (#111727)

Reverts llvm/llvm-project#111223

It broke one of the build bots:

LLVM Buildbot has detected a new failure on builder flang-aarch64-libcxx
running on linaro-flang-aarch64-libcxx while building llvm at step 5
"build-unified-tree".

Full details are available at:
https://lab.llvm.org/buildbot/#/builders/89/builds/8127

show more ...


# 10ada4ae 09-Oct-2024 Jorge Gorbe Moya <jgorbe@google.com>

[SandboxVectorizer] Use sbvec-passes flag to create a pipeline of Region passes after BottomUpVec. (#111223)

The main change is that the main SandboxVectorizer pass no longer has a
pipeline of func

[SandboxVectorizer] Use sbvec-passes flag to create a pipeline of Region passes after BottomUpVec. (#111223)

The main change is that the main SandboxVectorizer pass no longer has a
pipeline of function passes. Now it is a wrapper that creates sandbox IR
from functions before calling BottomUpVec.

BottomUpVec now builds its own RegionPassManager from the `sbvec-passes`
flag, using a PassRegistry.def file. For now, these region passes are
not run (BottomUpVec doesn't create Regions yet), and only a null pass
for testing exists.

This commit also changes the ownership model for sandboxir::PassManager:
instead of having a PassRegistry that owns passes, and PassManagers that
contain non-owning pointers to the passes, now PassManager owns (via
unique pointers) the passes it contains.

PassRegistry is now deleted, and the logic to parse and create a pass
pipeline is now in PassManager::setPassPipeline.

show more ...


Revision tags: llvmorg-19.1.1
# 2018f4cc 27-Sep-2024 Vasileios Porpodas <vporpodas@google.com>

Reapply "[SandboxIR][NFC] Delete SandboxIR.h (#110309)"

This reverts commit 8dfeb4ef5d60a5c764f0ce249cc4ec69e012ff93.


# 8dfeb4ef 27-Sep-2024 Vasileios Porpodas <vporpodas@google.com>

Revert "[SandboxIR][NFC] Delete SandboxIR.h (#110309)"

This reverts commit ca47f48a5c9e81ef8b5c4a5b1fbc473ea5d5497c.


# ca47f48a 27-Sep-2024 vporpo <vporpodas@google.com>

[SandboxIR][NFC] Delete SandboxIR.h (#110309)


Revision tags: llvmorg-19.1.0
# 5130f323 13-Sep-2024 vporpo <vporpodas@google.com>

[SandboxVec] User-defined pass pipeline (#108625)

This patch adds support for a user-defined pass-pipeline that overrides
the default pipeline of the vectorizer.
This will commonly be used by lit

[SandboxVec] User-defined pass pipeline (#108625)

This patch adds support for a user-defined pass-pipeline that overrides
the default pipeline of the vectorizer.
This will commonly be used by lit tests.

show more ...


# 39f2d2f1 13-Sep-2024 vporpo <vporpodas@google.com>

[SandboxVec] Boilerplate for vectorization passes (#108603)

This patch implements a new empty pass for the Bottom-up vectorizer and
creates a pass pipeline that includes it.
The SandboxVectorizer

[SandboxVec] Boilerplate for vectorization passes (#108603)

This patch implements a new empty pass for the Bottom-up vectorizer and
creates a pass pipeline that includes it.
The SandboxVectorizer LLVM pass runs the Sandbox IR pass pipeline.

show more ...


# d5bc1f4a 11-Sep-2024 Vasileios Porpodas <vporpodas@google.com>

[SandboxVec][NFC] Rename a variable


# c1c42518 05-Sep-2024 vporpo <vporpodas@google.com>

[SandboxVec] Early return checks (#107465)

This patch implements a couple of early return checks.


# 7ea9f0d8 05-Sep-2024 Vasileios Porpodas <vporpodas@google.com>

[SandboxVec][NFC] Remove unused header files


# 52dca6ff 05-Sep-2024 vporpo <vporpodas@google.com>

[SandboxVec] Boilerplate (#107431)

This patch implements the new pass and registers it with the pass
manager. For context, this is a vectorizer that operates on Sandbox IR,
which is a transactiona

[SandboxVec] Boilerplate (#107431)

This patch implements the new pass and registers it with the pass
manager. For context, this is a vectorizer that operates on Sandbox IR,
which is a transactional IR on top of LLVM IR.

show more ...