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

[CIR][Lowering] Lower non-global constant arrays #171

Merged
merged 2 commits into from
Jul 17, 2023

Conversation

sitio-couto
Copy link
Collaborator

@sitio-couto sitio-couto commented Jul 10, 2023

Stack from ghstack (oldest at bottom):

Lowers cir.const operations initialized with constant arrays to LLVM
const operations. Also adds supports for #const.array with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

[ghstack-poisoned]
sitio-couto added a commit that referenced this pull request Jul 10, 2023
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: 0a85dde2244aa9e945d320f55b6667add5f9be60
Pull Request resolved: #171
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with comments to address.

Note: This is indeed an interesting difference, if we forget about LLVM and think only about CIR for a moment, we're also not being uniform right now (my fault), given that const_struct attrs are used inline within cir.const and others are going through globals, at some point we need to migrate more.

clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp Outdated Show resolved Hide resolved
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

[ghstack-poisoned]
sitio-couto added a commit that referenced this pull request Jul 17, 2023
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: af42e9a89a27360f58657803ea452d890d2f2324
Pull Request resolved: #171
@sitio-couto sitio-couto merged commit 4bfb836 into gh/sitio-couto/45/base Jul 17, 2023
sitio-couto added a commit that referenced this pull request Jul 17, 2023
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: af42e9a89a27360f58657803ea452d890d2f2324
Pull Request resolved: #171
@sitio-couto sitio-couto deleted the gh/sitio-couto/45/head branch July 17, 2023 18:11
@lanza
Copy link
Member

lanza commented Jul 22, 2023

@sitio-couto This diff is causing test/CIR/Lowering/const.cir to fail on main.

@sitio-couto
Copy link
Collaborator Author

@sitio-couto This diff is causing test/CIR/Lowering/const.cir to fail on main.

@lanza sorry about that. #182 fixes this.

lanza pushed a commit that referenced this pull request Oct 27, 2023
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: af42e9a89a27360f58657803ea452d890d2f2324
Pull Request resolved: #171
lanza pushed a commit that referenced this pull request Dec 20, 2023
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: af42e9a89a27360f58657803ea452d890d2f2324
Pull Request resolved: #171
lanza pushed a commit that referenced this pull request Jan 29, 2024
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: af42e9a89a27360f58657803ea452d890d2f2324
Pull Request resolved: #171
lanza pushed a commit to lanza/llvm-project that referenced this pull request Feb 8, 2024
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: af42e9a89a27360f58657803ea452d890d2f2324
Pull Request resolved: llvm/clangir#171
lanza pushed a commit that referenced this pull request Mar 23, 2024
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: af42e9a89a27360f58657803ea452d890d2f2324
Pull Request resolved: #171
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Mar 24, 2024
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: af42e9a89a27360f58657803ea452d890d2f2324
Pull Request resolved: llvm#171
lanza pushed a commit that referenced this pull request Apr 29, 2024
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: af42e9a89a27360f58657803ea452d890d2f2324
Pull Request resolved: #171
lanza pushed a commit that referenced this pull request Apr 29, 2024
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: af42e9a89a27360f58657803ea452d890d2f2324
Pull Request resolved: #171
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Apr 29, 2024
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: af42e9a89a27360f58657803ea452d890d2f2324
Pull Request resolved: llvm#171
lanza pushed a commit that referenced this pull request Apr 29, 2024
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: af42e9a89a27360f58657803ea452d890d2f2324
Pull Request resolved: #171
pysuxing pushed a commit to pysuxing/llvm-project that referenced this pull request Jul 17, 2024
Lowers `cir.const` operations initialized with constant arrays to LLVM
const operations. Also adds supports for `#const.array` with string
literals.

This implementation differs from Clang: it does not create a global for
the constant array, nor uses memcpy to initialize the array. Instead, it
stores a constant value directly into the stack where it is used.

ghstack-source-id: af42e9a89a27360f58657803ea452d890d2f2324
Pull Request resolved: llvm/clangir#171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants