ac: destroy passes in ac_destroy_llvm_compiler
authorMarek Olšák <marek.olsak@amd.com>
Sat, 29 Jun 2019 06:25:23 +0000 (02:25 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 4 Jul 2019 19:39:04 +0000 (15:39 -0400)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/amd/common/ac_llvm_util.c
src/amd/vulkan/radv_llvm_helper.cpp
src/gallium/drivers/radeonsi/si_pipe.c

index c153d60d35b0c6eeda4e79e415978abe94f0a898..1cf51b79c765c662374c76fdc4a4e943db54f13a 100644 (file)
@@ -356,6 +356,9 @@ fail:
 void
 ac_destroy_llvm_compiler(struct ac_llvm_compiler *compiler)
 {
+       ac_destroy_llvm_passes(compiler->passes);
+       ac_destroy_llvm_passes(compiler->low_opt_passes);
+
        if (compiler->passmgr)
                LLVMDisposePassManager(compiler->passmgr);
        if (compiler->target_library_info)
index 036368b3d7cbd4d8b1612cf3c3fadd2e01ab2b0f..2b14ddcf1844a61a1b489e682e99d8d4c58fecc8 100644 (file)
@@ -33,7 +33,6 @@ public:
 
        ~radv_llvm_per_thread_info()
        {
-               ac_destroy_llvm_passes(passes);
                ac_destroy_llvm_compiler(&llvm_info);
        }
 
index 2ad164a50acde47d8dd7e679a657f92ae7b27861..0b3776b1f7fbeabc95b7914f91af2bd17bb065d6 100644 (file)
@@ -143,8 +143,6 @@ static void si_init_compiler(struct si_screen *sscreen,
 
 static void si_destroy_compiler(struct ac_llvm_compiler *compiler)
 {
-       ac_destroy_llvm_passes(compiler->passes);
-       ac_destroy_llvm_passes(compiler->low_opt_passes);
        ac_destroy_llvm_compiler(compiler);
 }