Skip to content

Conversation

@easyonaadit
Copy link
Contributor

@easyonaadit easyonaadit commented Jan 21, 2025

To get the allocation size for dynamic allocas,
first we scale the max_size by the wave_size,
and then bump SP by this amount.

addr = sp
size = max_size << wave_size
sp = addr + size

Currently, during DAG->DAG I-Sel, the scalar
left-shift and addition operations are being
folded into a v_lshl_add_u32 instruction
and then readfirstlane is used to copy the
value into SP.

This patch enforces the use of scalar operations,
removing the need for a readfirstlane instr.
This makes the code-gen for S-DAG and G-ISEL
uniform.

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.

1 participant