| ... | ... | @@ -1080,7 +1080,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { |
| 1080 | 1080 | |
| 1081 | 1081 | .constant => unreachable, // excluded from function bodies |
| 1082 | 1082 | .const_ty => unreachable, // excluded from function bodies |
| 1083 | | .unreach => self.finishAirBookkeeping(), |
| 1083 | .unreach => if (self.wantSafety()) try self.airTrap() else self.finishAirBookkeeping(), |
| 1084 | 1084 | |
| 1085 | 1085 | .optional_payload => try self.airOptionalPayload(inst), |
| 1086 | 1086 | .optional_payload_ptr => try self.airOptionalPayloadPtr(inst), |
| ... | ... | @@ -6273,6 +6273,15 @@ fn airBlock(self: *Self, inst: Air.Inst.Index) !void { |
| 6273 | 6273 | |
| 6274 | 6274 | const block_data = self.blocks.getPtr(inst).?; |
| 6275 | 6275 | const target_branch = self.branch_stack.pop(); |
| 6276 | |
| 6277 | log.debug("airBlock: %{d}", .{inst}); |
| 6278 | log.debug("Upper branches:", .{}); |
| 6279 | for (self.branch_stack.items) |bs| { |
| 6280 | log.debug("{}", .{bs.fmtDebug()}); |
| 6281 | } |
| 6282 | log.debug("Block branch: {}", .{block_data.branch.fmtDebug()}); |
| 6283 | log.debug("Target branch: {}", .{target_branch.fmtDebug()}); |
| 6284 | |
| 6276 | 6285 | try self.canonicaliseBranches(true, &block_data.branch, &target_branch, false, false); |
| 6277 | 6286 | |
| 6278 | 6287 | for (block_data.relocs.items) |reloc| try self.performReloc(reloc); |
| ... | ... | @@ -6444,7 +6453,7 @@ fn canonicaliseBranches( |
| 6444 | 6453 | // If integer overflow occurs, the question is: why wasn't the instruction marked dead? |
| 6445 | 6454 | break :blk self.getResolvedInstValue(target_key).?.*; |
| 6446 | 6455 | }; |
| 6447 | | log.debug("consolidating target_entry {d} {}=>{}", .{ target_key, target_value, canon_mcv }); |
| 6456 | log.debug("consolidating target_entry %{d} {}=>{}", .{ target_key, target_value, canon_mcv }); |
| 6448 | 6457 | // TODO handle the case where the destination stack offset / register has something |
| 6449 | 6458 | // going on there. |
| 6450 | 6459 | assert(!hazard_map.contains(target_value)); |
| ... | ... | @@ -6466,7 +6475,7 @@ fn canonicaliseBranches( |
| 6466 | 6475 | const parent_mcv = |
| 6467 | 6476 | if (canon_value != .dead) self.getResolvedInstValue(canon_key).?.* else undefined; |
| 6468 | 6477 | if (canon_value != .dead) { |
| 6469 | | log.debug("consolidating canon_entry {d} {}=>{}", .{ canon_key, parent_mcv, canon_value }); |
| 6478 | log.debug("consolidating canon_entry %{d} {}=>{}", .{ canon_key, parent_mcv, canon_value }); |
| 6470 | 6479 | // TODO handle the case where the destination stack offset / register has something |
| 6471 | 6480 | // going on there. |
| 6472 | 6481 | assert(!hazard_map.contains(parent_mcv)); |