PGO relies on profiling data collected primarily through two methods: instrumentation, where the program is modified to record execution details, and sampling, which uses OS or hardware capabilities (like Linux perf) to collect data from unmodified programs with lower overhead. A third, more advanced approach, is Context-Sensitive IR (CSIR) PGO, which instruments after inlining for better contextual information.