radeonsi: don't use allocas for arrays with LLVM 3.8
authorMarek Olšák <marek.olsak@amd.com>
Thu, 25 Aug 2016 18:22:59 +0000 (20:22 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 25 Aug 2016 19:19:17 +0000 (21:19 +0200)
It crashes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97413

src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c

index 71f52fddbd3776445c5e909aa0785b8a76f88fde..4643e6d0ce79671ca385a6e797b2bb2c4c76275d 100644 (file)
@@ -559,8 +559,10 @@ static void emit_declaration(struct lp_build_tgsi_context *bld_base,
                         * FIXME: We shouldn't need to have the non-alloca
                         * code path for arrays. LLVM should be smart enough to
                         * promote allocas into registers when profitable.
+                        *
+                        * LLVM 3.8 crashes with this.
                         */
-                       if (array_size > 16) {
+                       if (HAVE_LLVM >= 0x0309 && array_size > 16) {
                                array_alloca = LLVMBuildAlloca(builder,
                                        LLVMArrayType(bld_base->base.vec_type,
                                                      array_size), "array");