-
Notifications
You must be signed in to change notification settings - Fork 873
[Integrate] Drop llvm/llvm-project@b4c31dc revert. #21851
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
Changes from all commits
9cacd76
3c0a61c
aa3b722
7991268
037952a
5d6da75
022b1ca
b54c541
fd40597
f425594
5dc789b
93abd75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -172,6 +172,26 @@ static LogicalResult validateDataTypes(Operation *op, | |
| return success(); | ||
| } | ||
|
|
||
| /// TODO(hanchung): Delete the pattern once it is upstreamed: | ||
| /// https://github.com/llvm/llvm-project/pull/156992 | ||
| struct LowerToElementsPattern : public OpRewritePattern<vector::ToElementsOp> { | ||
| using OpRewritePattern::OpRewritePattern; | ||
| LogicalResult matchAndRewrite(vector::ToElementsOp op, | ||
| PatternRewriter &rewriter) const override { | ||
| VectorType vecType = op.getSource().getType(); | ||
| if (vecType.getRank() == 1 || vecType.getNumScalableDims() > 0) { | ||
| return failure(); | ||
| } | ||
| auto vec1DType = | ||
| VectorType::get({vecType.getNumElements()}, vecType.getElementType()); | ||
| Value shapeCast = rewriter.create<vector::ShapeCastOp>( | ||
| op.getLoc(), vec1DType, op.getSource()); | ||
|
Comment on lines
+187
to
+188
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if flattening was the right call, this shouldve been an unrolling pattern. Everything else does unrolling.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's made explicit this is mostly a stopgap patch
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fair enough |
||
| rewriter.replaceOpWithNewOp<vector::ToElementsOp>(op, op.getResultTypes(), | ||
| shapeCast); | ||
| return success(); | ||
| } | ||
| }; | ||
|
|
||
| /// A pass that replaces all occurrences of GPU device operations with their | ||
| /// corresponding ROCDL equivalent. | ||
| /// | ||
|
|
@@ -256,6 +276,7 @@ struct ConvertToROCDLPass final | |
| vector::populateVectorInterleaveToShufflePatterns(patterns); | ||
| vector::populateVectorContractLoweringPatterns( | ||
| patterns, options.vectorContractLowering); | ||
| vector::populateVectorFromElementsLoweringPatterns(patterns); | ||
| vector::populateVectorGatherLoweringPatterns(patterns); | ||
| vector::populateVectorMaskOpLoweringPatterns(patterns); | ||
| // We currently always use 64 bit indices, thus ensure the bit width of | ||
|
|
@@ -269,6 +290,7 @@ struct ConvertToROCDLPass final | |
| patterns, options.vectorTransposeLowering); | ||
| vector::populateVectorTransferLoweringPatterns(patterns); | ||
| arith::populateExpandBFloat16Patterns(patterns); | ||
| patterns.insert<LowerToElementsPattern>(&getContext()); | ||
| if (failed(applyPatternsGreedily(m, std::move(patterns)))) { | ||
| return signalPassFailure(); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.