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

Add "align" option for IRBuilder.alloca #1040

Open
isVoid opened this issue Apr 23, 2024 · 1 comment
Open

Add "align" option for IRBuilder.alloca #1040

isVoid opened this issue Apr 23, 2024 · 1 comment
Labels
feature_request Feature Request

Comments

@isVoid
Copy link

isVoid commented Apr 23, 2024

In official LLVMIR documentation , the alloca instruction has an optional align argument (at least in textural representation). When not specified, it is up to the target to choose a "convenient"
boundary for the type. llvmlite's alloca instruction doesn't have this argument and is always restricted to the target's alignment. This could leave some performance optimization on the table.

@gmarkall
Copy link
Member

I think this could also be a correctness issue if we're aiming to interoperate with code that requires particular alignment of structures - for example, IIRC complex values on CUDA are represented by a struct of 2 floats with an 8-byte alignment even when the natural alignment for that struct would be 4 bytes (I think @nvlcambier and I ran into this).

@gmarkall gmarkall added the feature_request Feature Request label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_request Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants