summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.pick_status.json2
-rw-r--r--src/amd/llvm/ac_nir_to_llvm.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 81cf82505e0..7463c3ee44f 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -265,7 +265,7 @@
"description": "ac/llvm: fix 16bit varying llvm compile error",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "279eea5bda2444fdce21744b972dad5016f0f366"
},
diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c
index 8d208f51396..9d3d60603a6 100644
--- a/src/amd/llvm/ac_nir_to_llvm.c
+++ b/src/amd/llvm/ac_nir_to_llvm.c
@@ -2410,7 +2410,16 @@ static void visit_store_output(struct ac_nir_context *ctx, nir_intrinsic_instr *
* using read-modify-write.
*/
index = LLVMConstInt(ctx->ac.i32, nir_intrinsic_io_semantics(instr).high_16bits, 0);
+
+#if LLVM_VERSION_MAJOR <= 14
+ /* To work around old LLVM bug which won't change the output type to
+ * LLVMBuildLoad2 type argument.
+ */
+ output = LLVMBuildLoad2(ctx->ac.builder, ctx->ac.f32, output_addr, "");
+ output = LLVMBuildBitCast(ctx->ac.builder, output, ctx->ac.v2f16, "");
+#else
output = LLVMBuildLoad2(ctx->ac.builder, ctx->ac.v2f16, output_addr, "");
+#endif
output = LLVMBuildInsertElement(ctx->ac.builder, output, value, index, "");
value = LLVMBuildBitCast(ctx->ac.builder, output, ctx->ac.f32, "");
}