This patch makes instruction referencing on-by-default for x86, as discussed in https://lists.llvm.org/pipermail/llvm-dev/2021-November/153653.html . I'm sure there'll be an amount of unexpected breakage, so I'll land in two parts, with a minimal sized patch switching the default so that reverting is easy.
It seems there are a number of complicated interactions between the cc1 arguments and the codegen flags -- I don't really want to untangle them, so I've just removed the cc1 argument for instruction referencing. It'll still be accessible with -mllvm -experimental-debug-variable-locations=true
This is probably the point to discuss tests that I'm not intending on updating for instruction referencing and still have -experimental-debug-variable-locations=false in the arguments. They are:
MIR/X86/dvl-livedebugvalues-clobber.mir MIR/X86/dvl-livedebugvalues-join.mir MIR/X86/dvl-livedebugvalues-movements.mir MIR/X86/dvl-livedebugvalues-spillrestore.mir X86/dbg-val-list-dangling.ll
^ they involve variadic variable locations, which is currently "future work" for December,
MIR/X86/kill-after-spill.mir MIR/X86/live-debug-values-restore-collide.mir MIR/X86/mlicm-hoist-post-regalloc.mir X86/live-debug-variables.ll X86/live-debug-vars-discard-invalid.mir X86/live-debug-vars-intervals.mir MIR/X86/live-debug-vars-unused-arg-debugonly.mir MIR/X86/live-debug-vars-unused-arg.mir MIR/X86/livedebugvars-crossbb-interval.mir MIR/X86/backup-entry-values-usage.mir
^ these all test very DBG_VALUE specific parts of code, usuallly LiveDebugVariables which is a no-op when using instruction referencing. One of them tests what VarLocBasedLDV does does with spills when they're followed by kill flags, which is another thing InstrRefBasedLDV doesn't care about.
Generic/linear-dbg-value.ll
^ this seems to just check that DBG_VALUE instructions are generated, I don't think it's really testing any interesting behaviours.