[VPlan] Make VPIRFlags verification type aware, fix remaining holes. (#213081)
Update hasRequiredFlagsForOpcode to also take the result type and use it
for flag verification for opcodes that can have flags depending on type
(like Phi, Select and Call).
Each of those sites is covered by existing tests, which assert without
the corresponding fix. The generated IR is unchanged, as the missing
flags are all empty by default.
Update all places we create selects and phis to properly pass through
the proper flags. VPBuilder helpers are extended to take flags as
std::optional, to make it easy to get the default flags automatically if
needed. It also ensures the callers have to pass in correct flags, if
they explicitly pass flags.
Currently depends on https://github.com/llvm/llvm-project/pull/212973.
PR: https://github.com/llvm/llvm-project/pull/213081