llvm-project/llvm/test/Transforms/HotColdSplit
Vedant Kumar a1778df474 [CodeExtractor] Do not extract unsafe lifetime markers
Lifetime markers which reference inputs to the extraction region are not
safe to extract. Example ('rhs' will be extracted):

```
               entry:
              +------------+
              | x = alloca |
              | y = alloca |
              +------------+
             /              \
   lhs:                      rhs:
  +-------------------+     +-------------------+
  | lifetime_start(x) |     | lifetime_start(x) |
  | use(x)            |     | lifetime_start(y) |
  | lifetime_end(x)   |     | use(x, y)         |
  | lifetime_start(y) |     | lifetime_end(y)   |
  | use(y)            |     | lifetime_end(x)   |
  | lifetime_end(y)   |     +-------------------+
  +-------------------+
```

Prior to extraction, the stack coloring pass sees that the slots for 'x'
and 'y' are in-use at the same time. After extraction, the coloring pass
infers that 'x' and 'y' are *not* in-use concurrently, because markers
from 'rhs' are no longer available to help decide otherwise.

This leads to a miscompile, because the stack slots actually are in-use
concurrently in the extracted function.

Fix this by moving lifetime start/end markers for memory regions defined
in the calling function around the call to the extracted function.

Fixes llvm.org/PR39671 (rdar://45939472).

Differential Revision: https://reviews.llvm.org/D55967

llvm-svn: 350420
2019-01-04 17:43:22 +00:00
..
X86 [HotColdSplitting] Use TTI to inform outlining threshold 2018-11-04 23:11:57 +00:00
delete-use-without-def-dbg-val.ll [CodeExtractor] Erase use-without-def debug intrinsics in parent func 2018-11-06 19:05:53 +00:00
do-not-split.ll [HotColdSplitting] Use TTI to inform outlining threshold 2018-11-04 23:11:57 +00:00
duplicate-phi-preds-crash.ll [CodeExtractor] Split PHI nodes with incoming values from outlined region (PR39433) 2018-12-03 22:40:21 +00:00
eh-pads.ll [HotColdSplitting] Disable outlining landingpad instructions (PR39917) 2018-12-11 18:05:31 +00:00
eh-typeid-for.ll [CodeExtractor] Do not extract calls to eh_typeid_for (PR39545) 2018-11-06 19:06:08 +00:00
extraction-subregion-breaks-phis.ll [HotColdSplitting] Outline more than once per function 2018-12-07 20:23:52 +00:00
forward-dfs-reaches-marked-block.ll [HotColdSplitting] Outline more than once per function 2018-12-07 20:23:52 +00:00
lifetime-markers-on-inputs.ll [CodeExtractor] Do not extract unsafe lifetime markers 2019-01-04 17:43:22 +00:00
mark-the-whole-func-cold.ll [HotColdSplitting] Outline more than once per function 2018-12-07 20:23:52 +00:00
minsize.ll [HotColdSplitting] Use TTI to inform outlining threshold 2018-11-04 23:11:57 +00:00
multiple-exits.ll [HotColdSplitting] Identify larger cold regions using domtree queries 2018-10-24 22:15:41 +00:00
noreturn.ll [HotColdSplitting] Refine definition of unlikelyExecuted 2018-12-07 20:24:04 +00:00
outline-cold-asm.ll [HotColdSplitting] Refine definition of unlikelyExecuted 2018-12-07 20:24:04 +00:00
outline-disjoint-diamonds.ll [HotColdSplitting] Outline more than once per function 2018-12-07 20:23:52 +00:00
outline-if-then-else.ll [HotColdSplitting] Identify larger cold regions using domtree queries 2018-10-24 22:15:41 +00:00
outline-multiple-entry-region.ll [HotColdSplitting] Outline more than once per function 2018-12-07 20:23:52 +00:00
outline-while-loop.ll [HotColdSplitting] Outline more than once per function 2018-12-07 20:23:52 +00:00
phi-with-distinct-outlined-values.ll [HotColdSplitting] Outline more than once per function 2018-12-07 20:23:52 +00:00
region-overlap.ll [HotColdSplitting] Outline more than once per function 2018-12-07 20:23:52 +00:00
split-cold-2.ll [CodeExtractor] Mark functions noreturn when applicable 2018-11-08 17:57:09 +00:00
split-out-dbg-val-of-arg.ll [HotColdSplitting] Use TTI to inform outlining threshold 2018-11-04 23:11:57 +00:00
succ-block-with-self-edge.ll [HotColdSplitting] Outline more than once per function 2018-12-07 20:23:52 +00:00
unwind.ll [CodeExtractor] Do not marked outlined calls which may resume EH as noreturn 2018-12-05 19:35:37 +00:00