The gcc torture test suite has examples where there is a function call (to a routine that throws an exception or aborts or something), followed by an "unreachable" instruction, followed by more code that may e.g. return a value to the caller. In these examples, the code following the unreachable is itself unreachable. Problems arise when the unreachable code references a variable defined in the reachable code. This triggers a liveness consistency error because the use of the variable has no reaching definition. It's a bit surprising that LLVM actually allows this, but it does so we need to deal with it. The solution is, after initial CFG construction, do a traversal starting from the entry node and then delete any undiscovered nodes. There is code in Subzero that assumes Cfg::Nodes[i]->Number == i, so the nodes need to be renumbered after pruning. The alternative was to set Nodes[i]=nullptr and not change the node number, but that would mean peppering the code base with CfgNode null checks. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/1027933002
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| 64bit.pnacl.ll | Loading commit data... | |
| 8bit.pnacl.ll | Loading commit data... | |
| abi-atomics.ll | Loading commit data... | |
| addr-opt-multi-def-var.ll | Loading commit data... | |
| address-mode-opt.ll | Loading commit data... | |
| align-spill-locations.ll | Loading commit data... | |
| alloc.ll | Loading commit data... | |
| arith-opt.ll | Loading commit data... | |
| bitcast.ll | Loading commit data... | |
| bool-opt.ll | Loading commit data... | |
| branch-opt.ll | Loading commit data... | |
| branch-simple.ll | Loading commit data... | |
| callindirect.pnacl.ll | Loading commit data... | |
| cmp-opt.ll | Loading commit data... | |
| convert.ll | Loading commit data... | |
| div_legalization.ll | Loading commit data... | |
| ebp_args.ll | Loading commit data... | |
| elf_container.ll | Loading commit data... | |
| elf_function_sections.ll | Loading commit data... | |
| elf_nodata.ll | Loading commit data... | |
| fp.pnacl.ll | Loading commit data... | |
| fp_const_pool.ll | Loading commit data... | |
| fpcall.ll | Loading commit data... | |
| fpconst.pnacl.ll | Loading commit data... | |
| function_aligned.ll | Loading commit data... | |
| globalinit.pnacl.ll | Loading commit data... | |
| globalrelocs.ll | Loading commit data... | |
| ias-multi-reloc.ll | Loading commit data... | |
| load.ll | Loading commit data... | |
| mangle.ll | Loading commit data... | |
| nacl-atomic-cmpxchg-optimization.ll | Loading commit data... | |
| nacl-atomic-errors.ll | Loading commit data... | |
| nacl-atomic-fence-all.ll | Loading commit data... | |
| nacl-atomic-intrinsics.ll | Loading commit data... | |
| nacl-other-intrinsics.ll | Loading commit data... | |
| nop-insertion.ll | Loading commit data... | |
| phi.ll | Loading commit data... | |
| prune_unreachable.ll | Loading commit data... | |
| randomize-regalloc.ll | Loading commit data... | |
| regalloc_evict_non_overlap.ll | Loading commit data... | |
| returns_twice_no_coalesce.ll | Loading commit data... | |
| sdiv.ll | Loading commit data... | |
| select-opt.ll | Loading commit data... | |
| shift.ll | Loading commit data... | |
| simple-loop.ll | Loading commit data... | |
| store.ll | Loading commit data... | |
| struct-arith.pnacl.ll | Loading commit data... | |
| switch-opt.ll | Loading commit data... | |
| test_i1.ll | Loading commit data... | |
| undef.ll | Loading commit data... | |
| unreachable.ll | Loading commit data... | |
| vector-arg.ll | Loading commit data... | |
| vector-arith.ll | Loading commit data... | |
| vector-bitcast.ll | Loading commit data... | |
| vector-cast.ll | Loading commit data... | |
| vector-fcmp.ll | Loading commit data... | |
| vector-icmp.ll | Loading commit data... | |
| vector-ops.ll | Loading commit data... | |
| vector-select.ll | Loading commit data... |