llvm-project/llvm/test/tools/llvm-profgen/Inputs
Hongtao Yu d5a963ab8b [PseudoProbe] Replace relocation with offset for entry probe.
Currently pseudo probe encoding for a function is like:
	- For the first probe, a relocation from it to its physical position in the code body
	- For subsequent probes, an incremental offset from the current probe to the previous probe

The relocation could potentially cause relocation overflow during link time. I'm now replacing it with an offset from the first probe to the function start address.

A source function could be lowered into multiple binary functions due to outlining (e.g, coro-split). Since those binary function have independent link-time layout, to really avoid relocations from .pseudo_probe sections to .text sections, the offset to replace with should really be the offset from the probe's enclosing binary function, rather than from the entry of the source function. This requires some changes to previous section-based emission scheme which now switches to be function-based. The assembly form of pseudo probe directive is also changed correspondingly, i.e, reflecting the binary function name.

Most of the source functions end up with only one binary function. For those don't, a sentinel probe is emitted for each of the binary functions with a different name from the source. The sentinel probe indicates the binary function name to differentiate subsequent probes from the ones from a different binary function. For examples, given source function

```
Foo() {
  …
  Probe 1
  …
  Probe 2
}
```

If it is transformed into two binary functions:

```
Foo:
   …

Foo.outlined:
   …
```

The encoding for the two binary functions will be separate:

```

GUID of Foo
  Probe 1

GUID of Foo
  Sentinel probe of Foo.outlined
  Probe 2
```

Then probe1 will be decoded against binary `Foo`'s address, and Probe 2 will be decoded against `Foo.outlined`. The sentinel probe of `Foo.outlined` makes sure there's not accidental relocation from `Foo.outlined`'s probes to `Foo`'s entry address.

On the BOLT side, to be minimal intrusive, the pseudo probe re-encoding sticks with the old encoding format. This is fine since unlike linker, Bolt processes the pseudo probe section as a whole and it is free from relocation overflow issues.

The change is downwards compatible as long as there's no mixed use of the old encoding and the new encoding.

Reviewed By: wenlei, maksfb

Differential Revision: https://reviews.llvm.org/D135912
Differential Revision: https://reviews.llvm.org/D135914
Differential Revision: https://reviews.llvm.org/D136394
2022-10-27 13:28:22 -07:00
..
artificial-branch.perfscript
callback-external-addr.perfbin
callback-external-addr.perfscript
cold-profile-trimming.raw.prof
coroutine.perfbin remove the internal signatures from perf binaries 2022-09-19 22:32:31 -07:00
coroutine.perfscript
cs-interrupt.perfscript
cs-invalid-ret-addr.perfscript
cs-preinline-cost.perfbin
cs-preinline-cost.perfscript
external-address.perfscript
fs-discriminator.perfbin
fs-discriminator.raw.prof
func-split.perfbin [PseudoProbe] Replace relocation with offset for entry probe. 2022-10-27 13:28:22 -07:00
func-split.perfscript
inline-cs-noprobe.perfbin
inline-cs-noprobe.perfscript
inline-cs-pseudoprobe.perfbin [PseudoProbe] Replace relocation with offset for entry probe. 2022-10-27 13:28:22 -07:00
inline-cs-pseudoprobe.perfscript
inline-noprobe.perfbin
inline-noprobe.perfscript
inline-noprobe2.perfbin
inline-noprobe2.perfscript
invalid-range.perfscript
multi-load-segs.perfbin remove the internal signatures from perf binaries 2022-09-19 22:32:31 -07:00
multi-load-segs.perfscript
noinline-cs-noprobe.aggperfscript
noinline-cs-noprobe.perfbin
noinline-cs-noprobe.perfscript
noinline-cs-pseudoprobe.aggperfscript
noinline-cs-pseudoprobe.perfbin
noinline-cs-pseudoprobe.perfscript [llvm-profgen] Fix inconsistent loading address issues 2022-10-13 23:19:30 -07:00
noprobe.aggperfscript
noprobe.mmap.perfscript
noprobe.perfbin
noprobe.perfscript
out-of-bounds.raw.prof
profile-density-cs.raw.prof
profile-density.raw.prof
recursion-compression-noprobe.perfbin
recursion-compression-noprobe.perfscript
recursion-compression-pseudoprobe-nommap.perfscript
recursion-compression-pseudoprobe.perfbin
recursion-compression-pseudoprobe.perfscript
split-dwarf-single.exe
split-dwarf-single.o.yaml
split-dwarf-split.dwo.yaml
split-dwarf-split.exe
symbolize.ll
symbolize.perfbin
truncated-pseudoprobe.ll
truncated-pseudoprobe.perfbin
truncated-pseudoprobe.perfscript
unique-linkage-name-dwarf.perfbin
unique-linkage-name-dwarf.perfscript
unique-linkage-name-probe.perfbin
unique-linkage-name-probe.perfscript