[PATCH] D28920: DAG: Allow targets to override stack temp alignment

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 16:39:03 PST 2017


arsenm added a comment.

In https://reviews.llvm.org/D28920#656702, @hfinkel wrote:

> Unless you'd like to extend stack temps to be put in other address spaces, isn't that a frontend issue (i.e. applies only to globals)?


This is something I would like to be able to do someday (but I think this would be purely a codegen problem, so wouldn't need to be seen the in the IR).

I'm not sure it's a frontend issue? The LangRef doesn't really define what the ABI alignment of a type really means. It seems of the few uses in clang of getPrefTypeAlignment (and all the ones I've looked at so far in llvm) are all used to create allocas and loads/stores from them.

The DataLayout has getPreferredAlignment(const Global Variable *GV), which appear to return the preferred type alignment only if it has no explicit alignment set. This is only used by a handful of places.


https://reviews.llvm.org/D28920





More information about the llvm-commits mailing list