[Option] Make Passes, Scalar, Instrumentation, and CGData options per-context (#232599)
Follow-up to #232365: drop `perContext = false` from PassesOptions,
ScalarOptions, InstrumentationOptions, and CGDataOptions.
* IR passes read their LLVMContext's options in run(). Legacy passes
that chose analyses from an option now always require them
(ConstantHoisting, StructurizeCFG, GVN).
* Pass parameters that an option overrides are combined in run(), so
-print-pipeline-passes no longer folds such options (e.g.
-bonus-inst-threshold) into the printed parameters.
* PipelineTuningOptions carries the library options to PassBuilder,
which falls back to the TargetMachine's. opt, clang, flang, and Polly
pass their module's.
* The CodeGenData singleton is configured by its first caller's context.
lld and llvm-cgdata pass an empty context, which reads the global
values their -mllvm sets.
LLM-aided
GitOrigin-RevId: 372a4c35991023298bbb35d3371f9010656fa176
2 files changed