Skip to content

Conversation

AdUhTkJm
Copy link
Contributor

This deals with some x86 aggregate types for CallConvLowering pass.

Suppose we have a simple struct like this.

struct dim3 { int x, y, z; };

It can be coerced into

struct dim3_ { uint64_t xy; int z; };

And for a function that receives it as an argument, OG does the following transformation for x86:

void f(dim3 arg) { /* Before */ }
void f(uint64_t xy, int z) { /* After */ }

Now this transformation is implemented in the CallConvLowering pass of CIR.

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 after nit

@AdUhTkJm AdUhTkJm force-pushed the main branch 3 times, most recently from 8f5faa7 to d1a7a64 Compare February 24, 2025 21:16
@bcardosolopes bcardosolopes merged commit 0018c12 into llvm:main Feb 24, 2025
12 checks passed
lanza pushed a commit that referenced this pull request Mar 18, 2025
This deals with some x86 aggregate types for CallConvLowering pass.

Suppose we have a simple struct like this.
```cpp
struct dim3 { int x, y, z; };
```
It can be coerced into
```cpp
struct dim3_ { uint64_t xy; int z; };
```
And for a function that receives it as an argument, OG does the
following transformation for x86:
```cpp
void f(dim3 arg) { /* Before */ }
void f(uint64_t xy, int z) { /* After */ }
```
Now this transformation is implemented in the CallConvLowering pass of
CIR.
terapines-osc-cir pushed a commit to Terapines/clangir that referenced this pull request Sep 2, 2025
This deals with some x86 aggregate types for CallConvLowering pass.

Suppose we have a simple struct like this.
```cpp
struct dim3 { int x, y, z; };
```
It can be coerced into
```cpp
struct dim3_ { uint64_t xy; int z; };
```
And for a function that receives it as an argument, OG does the
following transformation for x86:
```cpp
void f(dim3 arg) { /* Before */ }
void f(uint64_t xy, int z) { /* After */ }
```
Now this transformation is implemented in the CallConvLowering pass of
CIR.
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.

2 participants