Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Transform][Vectorization] canonicalize vector with physical vector #100

Open
wants to merge 81 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
d29f038
init
BRUCE11111 May 27, 2024
8d65cbf
add LoopInvariantCodeMotion and CSE
BRUCE11111 May 28, 2024
e6037e2
update for result use rewriter
BRUCE11111 May 30, 2024
24261e7
move functions in class
BRUCE11111 May 30, 2024
0709481
backup multireduction canonicalization
BRUCE11111 Jun 3, 2024
e04eaf6
update reduce operation
BRUCE11111 Jun 4, 2024
75e5546
update reduce
BRUCE11111 Jun 5, 2024
a648a12
Merge branch 'main' into xiaohui/vectorization
BRUCE11111 Jun 5, 2024
b80822b
record
BRUCE11111 Jun 8, 2024
a7f0e21
update reduce
BRUCE11111 Jun 25, 2024
9e4364b
record
BRUCE11111 Jun 27, 2024
b01472a
fix tests
BRUCE11111 Jul 5, 2024
947e5c0
temp record, please reset back
BRUCE11111 Jul 5, 2024
1101e86
temp record, please reset back
BRUCE11111 Jul 5, 2024
a943154
Merge branch 'main' into xiaohui/vectorization
BRUCE11111 Jul 5, 2024
7200565
add check test
BRUCE11111 Jul 8, 2024
26b2ab8
simplify code
BRUCE11111 Jul 11, 2024
380f173
refactor partial compitable operation fusion
BRUCE11111 Jul 18, 2024
7a71b25
fix reduce bug
BRUCE11111 Jul 22, 2024
ab7c4d0
add 16x16 transpose kernel
BRUCE11111 Jul 23, 2024
72f1a8b
update reduce, add shapecast, add single matmul test
BRUCE11111 Jul 25, 2024
6e1adc9
Merge remote-tracking branch 'origin/main' into xiaohui/vectorization
BRUCE11111 Jul 28, 2024
4c2b3b8
fix bugs
BRUCE11111 Jul 31, 2024
39524f3
fix wrong permutation map due to community pass greedy fold bug
BRUCE11111 Aug 1, 2024
ca28f7c
fix reduce bugs
BRUCE11111 Aug 3, 2024
37ea49b
fix useless vector operation
BRUCE11111 Aug 13, 2024
6480b46
Merge remote-tracking branch 'origin' into xiaohui/vectorization
BRUCE11111 Aug 13, 2024
5161921
update lowr tile vector code
BRUCE11111 Aug 16, 2024
747f63a
remove lower tile part
BRUCE11111 Aug 22, 2024
a38e34a
Merge branch 'main' into xiaohui/vectorization
BRUCE11111 Aug 22, 2024
788452e
update
BRUCE11111 Aug 22, 2024
894f268
disable printer
BRUCE11111 Aug 22, 2024
37a0447
fix transpose segmentation fault
BRUCE11111 Aug 23, 2024
a804c2d
update transpose index
BRUCE11111 Aug 28, 2024
7f7fb86
Merge branch 'main' into xiaohui/vectorization
BRUCE11111 Aug 29, 2024
c1d7136
simplify analyzer code
BRUCE11111 Aug 29, 2024
545cf98
fix clang-format
BRUCE11111 Aug 29, 2024
87e69e1
simplify multireduction generate loop code
BRUCE11111 Aug 30, 2024
dc00e70
update test
BRUCE11111 Aug 30, 2024
7ac81c7
simplify code
BRUCE11111 Sep 2, 2024
284a97b
add test
BRUCE11111 Sep 3, 2024
562657c
simplify reduction parallel generate for loop
BRUCE11111 Sep 3, 2024
3db8b18
add some comments
BRUCE11111 Sep 5, 2024
0c5e5a4
simplify nestedforloop generate
BRUCE11111 Sep 5, 2024
8bdf984
fix too many parameters in function
BRUCE11111 Sep 6, 2024
db59850
simplify function parameters
BRUCE11111 Sep 7, 2024
0353101
update
BRUCE11111 Sep 9, 2024
a08a3f8
Merge branch 'main' into xiaohui/vectorization
BRUCE11111 Sep 9, 2024
50d2e76
Merge branch 'main' into xiaohui/vectorization
BRUCE11111 Sep 9, 2024
10e73f4
test ci
BRUCE11111 Sep 9, 2024
eec389f
fix clang-format
BRUCE11111 Sep 9, 2024
cdbe4e2
fix format
BRUCE11111 Sep 9, 2024
27536a1
Merge branch 'main' into xiaohui/vectorization
BRUCE11111 Sep 9, 2024
5bf4a9f
enable mincrokernel op in vector
BRUCE11111 Sep 9, 2024
b0a26cd
fix comments
BRUCE11111 Sep 9, 2024
dfa5ea3
add comments
BRUCE11111 Sep 10, 2024
ffc5569
fix clang-tidy
BRUCE11111 Sep 10, 2024
32f20dd
remove unused function
BRUCE11111 Sep 10, 2024
a4382c2
split analysis file
BRUCE11111 Sep 13, 2024
1f0e3ce
Merge branch 'main' into xiaohui/vectorization
BRUCE11111 Sep 13, 2024
a79147c
add utils.cpp
BRUCE11111 Sep 13, 2024
3552eb6
fix license
BRUCE11111 Sep 13, 2024
3ef9f3a
fix code stype
BRUCE11111 Sep 13, 2024
a1f9988
enable broadcast op fusion
BRUCE11111 Sep 13, 2024
47687f1
add lower to vector pass in pipeline
BRUCE11111 Sep 13, 2024
1a2a9a1
use linalgx utils function
BRUCE11111 Sep 13, 2024
f96c544
temporaty save
BRUCE11111 Sep 14, 2024
bec59ab
rename file name
BRUCE11111 Sep 18, 2024
4c901c4
push local change
BRUCE11111 Sep 18, 2024
9b6e6c8
fix reduce loop indice
BRUCE11111 Sep 19, 2024
aac20a0
simplify code
BRUCE11111 Sep 20, 2024
9a62f0b
Merge branch 'main' into xiaohui/vectorization
BRUCE11111 Sep 20, 2024
919dd11
update reduction rectify indice code
BRUCE11111 Sep 23, 2024
0e7794c
use CRTP and type trait to avoid virtual function to improve compile …
BRUCE11111 Sep 24, 2024
705d249
fix comments
BRUCE11111 Sep 25, 2024
d49715c
remove unused function
BRUCE11111 Sep 26, 2024
ba356ab
Merge branch 'main' into xiaohui/vectorization
BRUCE11111 Sep 27, 2024
d8e968f
Merge branch 'main' into xiaohui/vectorization
BRUCE11111 Sep 27, 2024
57bec50
fix comments
BRUCE11111 Oct 8, 2024
e8d7612
Merge branch 'main' into xiaohui/vectorization
BRUCE11111 Oct 8, 2024
028d4f4
Merge branch 'main' into xiaohui/vectorization
BRUCE11111 Oct 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions include/gc/Transforms/TilingVector.h
Original file line number Diff line number Diff line change
@@ -78,6 +78,7 @@ void checkAndSetOperand(
class VectorFusionStrategy {
private:
llvm::SmallVector<std::queue<Operation *>, 8> opGroups;
llvm::SmallVector<uint32_t, 8> groupMaxSteps;
// query current operation in which group, return group index
llvm::DenseMap<Operation *, size_t> opGroupIndexMap;
// can fused into prev operation which axis position
@@ -94,6 +95,7 @@ class VectorFusionStrategy {
llvm::DenseMap<Operation *, size_t> &getOpGroupIndexMap() {
return opGroupIndexMap;
}
llvm::SmallVector<uint32_t, 8> &getGroupMaxSteps() { return groupMaxSteps; }

func::FuncOp getFunc() { return func; }
llvm::SmallVector<std::queue<Operation *>, 8> getIgnoreInitOperations() {
@@ -186,6 +188,16 @@ class TransposeCanonicalizer
void prepareSpecialOperationInfo() override {}
};

class ShapeCastCanonicalizer
: virtual public SpecialOperationCanonicalizer<vector::ShapeCastOp> {
private:
public:
ShapeCastCanonicalizer(
const llvm::SmallVector<vector::ShapeCastOp, 4> &candidateScOps)
: SpecialOperationCanonicalizer<vector::ShapeCastOp>(candidateScOps){};
void prepareSpecialOperationInfo() override {}
};

class CanonicalizerCommonUsedData {
private:
VectorFusionStrategy fusionStrategy;
@@ -198,6 +210,7 @@ class CanonicalizerCommonUsedData {
llvm::SmallVector<MultiReductionCanonicalizer, 8> multiRdCanonicalizers;
llvm::SmallVector<BroadcastCanonicalizer, 8> broadcastCanonicalizers;
llvm::SmallVector<TransposeCanonicalizer, 8> transposeCanonicalizers;
llvm::SmallVector<ShapeCastCanonicalizer, 8> shapeCastCanonicalizers;

public:
CanonicalizerCommonUsedData() = default;
@@ -265,6 +278,10 @@ class CanonicalizerCommonUsedData {
return transposeCanonicalizers;
}

llvm::SmallVector<ShapeCastCanonicalizer, 8> &getShapeCastCanonicalizer() {
return shapeCastCanonicalizers;
}

// other methods
void initSpeicalOperationCanonicalizers();
};
@@ -296,6 +313,7 @@ class CanonicalizerVectorOperation {

void generateGroupOpVectorizedIR(const int idx);

void analysisEmptyGroupAndMaxSteps();
void analysisGroupOperaionOperandsResults();

void generateEmptyTensorAndWrite(
@@ -308,6 +326,8 @@ class CanonicalizerVectorOperation {
IRRewriter &rewriter);
void rewriteOperationAsVectorize(OpBuilder &rewriter, size_t groupId,
const std::queue<Operation *> &queue = {});
void createNewConstantOp(Operation *srcOp,
vector::TransferWriteOp *transferWriteOp);

// special operation methods
scf::ForOp generateMultiReductionForLoop(const size_t grpIdx);
Loading