-
Notifications
You must be signed in to change notification settings - Fork 100
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][CIRGen] Add dynamic builtin alloca intrinsics support #547
[CIR][CIRGen] Add dynamic builtin alloca intrinsics support #547
Conversation
44b4d75
to
0203a7c
Compare
Embarrassing formatting and lit-tests errors fixed and verified locally 🤦 |
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.
Thanks for your first PR, looking forward to see more contributions :)
I'm aware this is rather an "esoteric" feature to be supported and I'm sure there are more valuable features to implement before that! Implementing this feature was my method of learning more about the development flow for CIR - working along side clang's codegen, testing and debugging flow, etc.
No sweat, feel free to work on whatever makes you excited. Btw, these are actually important, since they show up in base system libraries, which are crucial to get CIR support bottom up in common software stacks.
0203a7c
to
3be2c19
Compare
Thanks for the review!! Will address the comments in the coming days. |
8ef26e6
to
c5d3451
Compare
This patch adds the CIRGen for the following builtin functions: - `alloca`; - `_alloca`; - `__builtin_alloca`; - `__builtin_alloca_uninitialized`. Missing support to add in the future: - Non-default auto initialization setting. The default is to not initialize the allocated buffer, which is simpler to implement. This commit is leaving the skeleton to implement this feature following clang's codegen pattern. - It may be possible that the frontend has set non-default address space for the alloca's return value. This is the case for OpenCL or AMDGPU codes for example. This is handled in clang codegen via address space cast, and is left for future implementation. This commit introduces a guard-rail around this behaviour.
c5d3451
to
4e37957
Compare
Addressed all comments, main changes:
|
@bcardosolopes do you think we can land this? :) |
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.
LGTM
This patch adds the CIRGen for the following builtin functions: - `alloca`; - `_alloca`; - `__builtin_alloca`; - `__builtin_alloca_uninitialized`. Missing support to add in the future: - Non-default auto initialization setting. The default is to not initialize the allocated buffer, which is simpler to implement. This commit is leaving the skeleton to implement this feature following clang's codegen pattern. - It may be possible that the frontend has set non-default address space for the alloca's return value. This is the case for OpenCL or AMDGPU codes for example. This is handled in clang codegen via address space cast, and is left for future implementation. This commit introduces a guard-rail around this behaviour.
This patch adds the CIRGen for the following builtin functions: - `alloca`; - `_alloca`; - `__builtin_alloca`; - `__builtin_alloca_uninitialized`. Missing support to add in the future: - Non-default auto initialization setting. The default is to not initialize the allocated buffer, which is simpler to implement. This commit is leaving the skeleton to implement this feature following clang's codegen pattern. - It may be possible that the frontend has set non-default address space for the alloca's return value. This is the case for OpenCL or AMDGPU codes for example. This is handled in clang codegen via address space cast, and is left for future implementation. This commit introduces a guard-rail around this behaviour.
This patch adds the CIRGen for the following builtin functions: - `alloca`; - `_alloca`; - `__builtin_alloca`; - `__builtin_alloca_uninitialized`. Missing support to add in the future: - Non-default auto initialization setting. The default is to not initialize the allocated buffer, which is simpler to implement. This commit is leaving the skeleton to implement this feature following clang's codegen pattern. - It may be possible that the frontend has set non-default address space for the alloca's return value. This is the case for OpenCL or AMDGPU codes for example. This is handled in clang codegen via address space cast, and is left for future implementation. This commit introduces a guard-rail around this behaviour.
This patch adds the CIRGen for the following builtin functions: - `alloca`; - `_alloca`; - `__builtin_alloca`; - `__builtin_alloca_uninitialized`. Missing support to add in the future: - Non-default auto initialization setting. The default is to not initialize the allocated buffer, which is simpler to implement. This commit is leaving the skeleton to implement this feature following clang's codegen pattern. - It may be possible that the frontend has set non-default address space for the alloca's return value. This is the case for OpenCL or AMDGPU codes for example. This is handled in clang codegen via address space cast, and is left for future implementation. This commit introduces a guard-rail around this behaviour.
This patch adds the CIRGen for the following builtin functions: - `alloca`; - `_alloca`; - `__builtin_alloca`; - `__builtin_alloca_uninitialized`. Missing support to add in the future: - Non-default auto initialization setting. The default is to not initialize the allocated buffer, which is simpler to implement. This commit is leaving the skeleton to implement this feature following clang's codegen pattern. - It may be possible that the frontend has set non-default address space for the alloca's return value. This is the case for OpenCL or AMDGPU codes for example. This is handled in clang codegen via address space cast, and is left for future implementation. This commit introduces a guard-rail around this behaviour.
This patch adds the CIRGen for the following builtin functions: - `alloca`; - `_alloca`; - `__builtin_alloca`; - `__builtin_alloca_uninitialized`. Missing support to add in the future: - Non-default auto initialization setting. The default is to not initialize the allocated buffer, which is simpler to implement. This commit is leaving the skeleton to implement this feature following clang's codegen pattern. - It may be possible that the frontend has set non-default address space for the alloca's return value. This is the case for OpenCL or AMDGPU codes for example. This is handled in clang codegen via address space cast, and is left for future implementation. This commit introduces a guard-rail around this behaviour.
This patch adds the CIRGen for the following builtin functions: - `alloca`; - `_alloca`; - `__builtin_alloca`; - `__builtin_alloca_uninitialized`. Missing support to add in the future: - Non-default auto initialization setting. The default is to not initialize the allocated buffer, which is simpler to implement. This commit is leaving the skeleton to implement this feature following clang's codegen pattern. - It may be possible that the frontend has set non-default address space for the alloca's return value. This is the case for OpenCL or AMDGPU codes for example. This is handled in clang codegen via address space cast, and is left for future implementation. This commit introduces a guard-rail around this behaviour.
This patch adds the CIRGen for the following builtin functions:
alloca
;_alloca
;__builtin_alloca
;__builtin_alloca_uninitialized
.Missing support to add in the future:
P.S.:
I'm aware this is rather an "esoteric" feature to be supported and I'm sure there are more valuable features to implement before that! Implementing this feature was my method of learning more about the development flow for CIR - working along side clang's codegen, testing and debugging flow, etc.