[v2,01/12] ac: do not force enable IDXEN for 16-bit SSBO loads

Submitted by Samuel Pitoiset on March 13, 2019, 10:50 a.m.

Details

Message ID 20190313105020.17683-2-samuel.pitoiset@gmail.com
State New
Headers show
Series "ac: use LLVM 8 buffer intrinsics everywhere" ( rev: 2 ) in Mesa

Not browsing as part of any series.

Commit Message

Samuel Pitoiset March 13, 2019, 10:50 a.m.
The struct version enables IDXEN, while the raw one disables it.
When vindex is unused, the raw version is enough.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 src/amd/common/ac_llvm_build.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index bc64f0bb7e3..8960b5ad4ff 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -1383,11 +1383,13 @@  ac_build_tbuffer_load_short(struct ac_llvm_context *ctx,
 	LLVMValueRef res;
 
 	if (HAVE_LLVM >= 0x0800) {
+		bool structurized = vindex && vindex != ctx->i32_0;
+
 		voffset = LLVMBuildAdd(ctx->builder, voffset, immoffset, "");
 
 		res = ac_build_llvm8_tbuffer_load(ctx, rsrc, vindex, voffset,
 						  soffset, 1, dfmt, nfmt, glc,
-						  false, true, true);
+						  false, true, structurized);
 	} else {
 		const char *name = "llvm.amdgcn.tbuffer.load.i32";
 		LLVMTypeRef type = ctx->i32;

Comments

NAK.  The entire thing about an index being used and possibly still
constant 0 (and hence the index being constant 0 is not a sign to use
the raw intrinsics) is why we now have both structurized and raw
intrinsics. Don't just introduce that mistake again ....

On Wed, Mar 13, 2019 at 11:47 AM Samuel Pitoiset
<samuel.pitoiset@gmail.com> wrote:
>
> The struct version enables IDXEN, while the raw one disables it.
> When vindex is unused, the raw version is enough.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
> ---
>  src/amd/common/ac_llvm_build.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
> index bc64f0bb7e3..8960b5ad4ff 100644
> --- a/src/amd/common/ac_llvm_build.c
> +++ b/src/amd/common/ac_llvm_build.c
> @@ -1383,11 +1383,13 @@ ac_build_tbuffer_load_short(struct ac_llvm_context *ctx,
>         LLVMValueRef res;
>
>         if (HAVE_LLVM >= 0x0800) {
> +               bool structurized = vindex && vindex != ctx->i32_0;
> +
>                 voffset = LLVMBuildAdd(ctx->builder, voffset, immoffset, "");
>
>                 res = ac_build_llvm8_tbuffer_load(ctx, rsrc, vindex, voffset,
>                                                   soffset, 1, dfmt, nfmt, glc,
> -                                                 false, true, true);
> +                                                 false, true, structurized);
>         } else {
>                 const char *name = "llvm.amdgcn.tbuffer.load.i32";
>                 LLVMTypeRef type = ctx->i32;
> --
> 2.21.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev