-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[CIR][Upstream] Local initialization for ArrayType #132974
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
Merged
AmrDeveloper
merged 15 commits into
llvm:main
from
AmrDeveloper:cir_upstream_array_local_init
Apr 3, 2025
Merged
Changes from 4 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4dc1e77
[CIR] [Upstream local initialization for ArrayType
AmrDeveloper ee9c92f
Address code review comments and add getConstantInt
AmrDeveloper d479f0d
Address code review comments
AmrDeveloper 9e10f04
Address code review comments
AmrDeveloper ed0a86b
Address code review comments
AmrDeveloper 56ef35e
Add missing features
AmrDeveloper 7fa7016
Merge branch 'main' into cir_upstream_array_local_init
AmrDeveloper 77a7d5f
Merge remote-tracking branch 'origin/main' into cir_upstream_array_lo…
AmrDeveloper e814e46
Fix merge conflict
AmrDeveloper 50b178f
Remove unused variable
AmrDeveloper 9a9e494
Address code review comments
AmrDeveloper 1609aad
Merge branch 'main' into cir_upstream_array_local_init
AmrDeveloper 8685a63
Merge branch 'main' into cir_upstream_array_local_init
AmrDeveloper 4f1be09
Put emitAggExpr in the correct order
AmrDeveloper 6f29bf8
Merge branch 'main' into cir_upstream_array_local_init
AmrDeveloper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| //====- LoweringHelpers.h - Lowering helper functions ---------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // This file declares helper functions for lowering from CIR to LLVM or MLIR. | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| #ifndef LLVM_CLANG_CIR_LOWERINGHELPERS_H | ||
| #define LLVM_CLANG_CIR_LOWERINGHELPERS_H | ||
|
|
||
| #include "mlir/IR/BuiltinAttributes.h" | ||
| #include "mlir/Transforms/DialectConversion.h" | ||
| #include "clang/CIR/Dialect/IR/CIRDialect.h" | ||
|
|
||
| mlir::DenseElementsAttr | ||
| convertStringAttrToDenseElementsAttr(cir::ConstArrayAttr attr, mlir::Type type); | ||
|
|
||
| template <typename StorageTy> StorageTy getZeroInitFromType(mlir::Type ty); | ||
| template <> mlir::APInt getZeroInitFromType(mlir::Type ty); | ||
| template <> mlir::APFloat getZeroInitFromType(mlir::Type ty); | ||
|
|
||
| template <typename AttrTy, typename StorageTy> | ||
| void convertToDenseElementsAttrImpl(cir::ConstArrayAttr attr, | ||
| llvm::SmallVectorImpl<StorageTy> &values); | ||
|
|
||
| template <typename AttrTy, typename StorageTy> | ||
| mlir::DenseElementsAttr | ||
| convertToDenseElementsAttr(cir::ConstArrayAttr attr, | ||
| const llvm::SmallVectorImpl<int64_t> &dims, | ||
| mlir::Type type); | ||
|
|
||
| std::optional<mlir::Attribute> | ||
| lowerConstArrayAttr(cir::ConstArrayAttr constArr, | ||
| const mlir::TypeConverter *converter); | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let merge the zero-init change first and rebase this one to get the changes there.