[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-19 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon closed https://github.com/llvm/llvm-project/pull/98629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-19 Thread Mariya Podchishchaeva via cfe-commits
Fznamznon wrote: Closing since https://github.com/llvm/llvm-project/pull/99257 fixed the problem without side effects. Thank you very much @efriedma-quic https://github.com/llvm/llvm-project/pull/98629 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-16 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: Oh, I see, there are two checks: one for the "align" attribute, and a separate check for the natural alignment of the type. I'm trying out changing the limit to see how hard it actually is. https://github.com/llvm/llvm-project/pull/98629 ___

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-16 Thread Eli Friedman via cfe-commits
https://github.com/efriedma-quic commented: What's the relationship between the max vector alignment, and choosing whether to return a vector directly? As long as clang isn't emitting the byval attribute, I don't think it's the frontend's problem. https://github.com/llvm/llvm-project/pull/986

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-16 Thread Mariya Podchishchaeva via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; Fznamznon wrote: Ok, I updated the patch to use `MaxVectorAlign` instead. Thanks https://github.com/llvm/llvm-project/pu

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-16 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon updated https://github.com/llvm/llvm-project/pull/98629 >From ba498f559c742e62c13a09cb0b909d57d986e19e Mon Sep 17 00:00:00 2001 From: "Podchishchaeva, Mariya" Date: Fri, 12 Jul 2024 06:13:51 -0700 Subject: [PATCH 1/2] [clang] Limit alignment for emitted vectors The

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-16 Thread Phoebe Wang via cfe-commits
https://github.com/phoebewang edited https://github.com/llvm/llvm-project/pull/98629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-16 Thread Phoebe Wang via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; phoebewang wrote: That makes sense. Passing/returning vector larger than target capacity (e.g. <4 x i64> without AVX) is

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-16 Thread Mariya Podchishchaeva via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; Fznamznon wrote: I pasted log in a weird way, sorry, all failures in this particular test I see are for Darwin. ``` // M

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-16 Thread Phoebe Wang via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; phoebewang wrote: I noticed that, but the value is set for Darwin, but the failure prefix is a non Darwin one. https://

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-15 Thread Mariya Podchishchaeva via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; Fznamznon wrote: Because `MaxVectorAlign` is set to a smaller value for some x86 targets - https://github.com/llvm/llvm-

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-15 Thread Phoebe Wang via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; phoebewang wrote: Right, sorry for the misleading. We still need to turn it to sret when vector size > 2^14. Then why yo

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-15 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: > BTW, I think the limitation I'm hitting is introduced by > https://reviews.llvm.org/D121898 . The limitation existed before that; we just miscompiled instead of reporting an error. https://github.com/llvm/llvm-project/pull/98629

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-15 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon edited https://github.com/llvm/llvm-project/pull/98629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-15 Thread Mariya Podchishchaeva via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; Fznamznon wrote: I'm not sure it will? With only modifying base TargetInfo clang will continue emit LLVM IR where giant

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-15 Thread Phoebe Wang via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; phoebewang wrote: I think set `MaxVectorAlign = 2^14` in base TargetInfo only should solve the problem and won't result

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-15 Thread Mariya Podchishchaeva via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; Fznamznon wrote: I did MaxVectorAlign = 2^14 in base TargetInfo, ``` if (Ty->getAs() && getContext().getType

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-15 Thread Phoebe Wang via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; phoebewang wrote: I'm surprised the change of alignment affects ABI. Did you just expand ``` MaxVectorAlign =

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-15 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon edited https://github.com/llvm/llvm-project/pull/98629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-15 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon edited https://github.com/llvm/llvm-project/pull/98629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-15 Thread Mariya Podchishchaeva via cfe-commits
Fznamznon wrote: BTW, I think the limitation I'm hitting is introduced by https://reviews.llvm.org/D121898 . https://github.com/llvm/llvm-project/pull/98629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-15 Thread Mariya Podchishchaeva via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; Fznamznon wrote: `MaxVectorAlign` is set for x86 targets. I can use it as a limit as well, but note that this patch also

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-13 Thread Phoebe Wang via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; phoebewang wrote: There's no special limitaion on x86. We can change ArgFlagsTy if the size is not the concern. https:/

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-12 Thread Eli Friedman via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; efriedma-quic wrote: It's used in the same ASTContext code that's modified by this patch. Probably fine to adjust it fo

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-12 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: The size of ArgFlagsTy is, as far as I can tell, basically irrelevant: it's only used as part of computing the calling convention in isel. I don't think anyone will notice if it's a few bytes larger. The non-byval alignment limit was last adjusted in https://reviews.llvm

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-12 Thread Phoebe Wang via cfe-commits
@@ -133,6 +133,7 @@ struct TransferrableTargetInfo { unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; phoebewang wrote: What's this used for? Can we limit it to 2^14? https://github.com/llvm/llvm-project/pull/98629 ___

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-12 Thread Phoebe Wang via cfe-commits
phoebewang wrote: > > max aligment [...] LLVM Verifier accepts is 2^14 > > The verifier limit in most places is 2^32. It looks like 2^14 is specifically > for ByVal. And there isn't really any good reason for that limit; it was > arbitrarily chosen in > [66011c1](https://github.com/llvm/llvm-

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-12 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: (The relevant bitfield is was renamed to MemAlign, and is now in llvm/include/llvm/CodeGen/TargetCallingConv.h) https://github.com/llvm/llvm-project/pull/98629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-12 Thread Eli Friedman via cfe-commits
efriedma-quic wrote: > max aligment [...] LLVM Verifier accepts is 2^14 The verifier limit in most places is 2^32. It looks like 2^14 is specifically for ByVal. And there isn't really any good reason for that limit; it was arbitrarily chosen in b567e3ffb0, nearly two decades ago, and could e

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 @llvm/pr-subscribers-clang Author: Mariya Podchishchaeva (Fznamznon) Changes The max aligment that ISel and therefore LLVM Verifier accepts is 2^14. The patch also forces indirect passing and returning of vectors bigger than this limit for

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-12 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-codegen Author: Mariya Podchishchaeva (Fznamznon) Changes The max aligment that ISel and therefore LLVM Verifier accepts is 2^14. The patch also forces indirect passing and returning of vectors bigger than this limit for generic and x86_64 target

[clang] [clang] Limit alignment for emitted vectors (PR #98629)

2024-07-12 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon created https://github.com/llvm/llvm-project/pull/98629 The max aligment that ISel and therefore LLVM Verifier accepts is 2^14. The patch also forces indirect passing and returning of vectors bigger than this limit for generic and x86_64 targets. >From ba498f559c7