[PATCH] D110257: [CFE][Codegen] Make sure to maintain the contiguity of all the static allocas

Mahesha S via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 16 00:11:39 PST 2021


hsmhsm added a comment.

In D110257#3133838 <https://reviews.llvm.org/D110257#3133838>, @JonChesterfield wrote:

> Please change the commit message to say why this change is necessary / an improvement on what we have now.
>
> My recollection is that the amdgpu backend crashes on some IR and this decreases the probability of that IR pattern occuring, which still sounds like fixing the wrong place to me. Was this the one where hoisting static size alloca into the entry block near the backend would the problem?
>
> I think this patch is missing a documentation update adding the new constraint that allocas must be contiguous in IR. That would help to answer questions about which alloca must be contiguous and which can occur separated by instructions, as currently none of them need to be adjacent. Also, is this only intended to constrain the entry basic block?

The current commit message reflect semantics of the patch - there is nothing required to change here. The goal here is to make sure that FE keeps all the static allocas as one cluster at the start of the entry block, which is a good canonical form from the perspective of better code transformation/optimization.

This is not something specific to AMDGPU backend, but  AMDGPU backend at present requires this canonical form.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110257/new/

https://reviews.llvm.org/D110257



More information about the cfe-commits mailing list