aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_opt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-03-09 15:39:41 +0000
committergingerBill <bill@gingerbill.org>2023-03-09 15:39:41 +0000
commit7c0257fcdad00cbb66d1d089715ec0ad684fd4c0 (patch)
treeb950281055dd6635ff24f10fddce8049049d29a9 /src/llvm_backend_opt.cpp
parent9af6d6c9c69bb3f913e08a309d389737ca09080e (diff)
Fix value elision on declaration
Diffstat (limited to 'src/llvm_backend_opt.cpp')
-rw-r--r--src/llvm_backend_opt.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/llvm_backend_opt.cpp b/src/llvm_backend_opt.cpp
index e06042341..61f51b15b 100644
--- a/src/llvm_backend_opt.cpp
+++ b/src/llvm_backend_opt.cpp
@@ -275,6 +275,9 @@ gb_internal void lb_populate_module_pass_manager(LLVMTargetMachineRef target_mac
**************************************************************************/
gb_internal void lb_run_remove_dead_instruction_pass(lbProcedure *p) {
+ unsigned debug_declare_id = LLVMLookupIntrinsicID("llvm.dbg.declare", 16);
+ GB_ASSERT(debug_declare_id != 0);
+
isize removal_count = 0;
isize pass_count = 0;
isize const max_pass_count = 10;
@@ -310,6 +313,8 @@ gb_internal void lb_run_remove_dead_instruction_pass(lbProcedure *p) {
// NOTE(bill): Explicit instructions are set here because some instructions could have side effects
switch (LLVMGetInstructionOpcode(curr_instr)) {
+ // case LLVMAlloca:
+
case LLVMFNeg:
case LLVMAdd:
case LLVMFAdd:
@@ -329,7 +334,6 @@ gb_internal void lb_run_remove_dead_instruction_pass(lbProcedure *p) {
case LLVMAnd:
case LLVMOr:
case LLVMXor:
- case LLVMAlloca:
case LLVMLoad:
case LLVMGetElementPtr:
case LLVMTrunc: