
This feature was previously controlled by a TargetOptions flag, and I figured that codegen::InitTargetOptionsFromCodeGenFlags would default it to "on" for all frontends. Enabling by default was discussed here: https://lists.llvm.org/pipermail/llvm-dev/2021-November/153653.html and originally supposed to happen in 3c045070882f3, but it didn't actually take effect, as it turns out frontends initialize TargetOptions themselves. This patch moves the flag from a TargetOptions flag to a global flag to CodeGen, where it isn't immediately affected by the frontend being used. Hopefully this will actually cause instr-ref to be on by default on x86_64 now! This patch is easily reverted, and chances of turbulence are moderately high. If you need to revert, please consider instead commenting out the 'return true' part of llvm::debuginfoShouldUseDebugInstrRef to turn the feature off, and dropping me an email. Differential Revision: https://reviews.llvm.org/D116821
45 lines
1.5 KiB
C++
45 lines
1.5 KiB
C++
//===- LiveDebugValues.cpp - Tracking Debug Value MIs ---------*- C++ -*---===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_CODEGEN_LIVEDEBUGVALUES_LIVEDEBUGVALUES_H
|
|
#define LLVM_LIB_CODEGEN_LIVEDEBUGVALUES_LIVEDEBUGVALUES_H
|
|
|
|
#include "llvm/CodeGen/MachineDominators.h"
|
|
#include "llvm/CodeGen/MachineFunction.h"
|
|
#include "llvm/CodeGen/TargetPassConfig.h"
|
|
#include "llvm/ADT/Triple.h"
|
|
|
|
namespace llvm {
|
|
|
|
// Inline namespace for types / symbols shared between different
|
|
// LiveDebugValues implementations.
|
|
inline namespace SharedLiveDebugValues {
|
|
|
|
// Expose a base class for LiveDebugValues interfaces to inherit from. This
|
|
// allows the generic LiveDebugValues pass handles to call into the
|
|
// implementation.
|
|
class LDVImpl {
|
|
public:
|
|
virtual bool ExtendRanges(MachineFunction &MF, MachineDominatorTree *DomTree,
|
|
TargetPassConfig *TPC, unsigned InputBBLimit,
|
|
unsigned InputDbgValLimit) = 0;
|
|
virtual ~LDVImpl() {}
|
|
};
|
|
|
|
} // namespace SharedLiveDebugValues
|
|
|
|
// Factory functions for LiveDebugValues implementations.
|
|
extern LDVImpl *makeVarLocBasedLiveDebugValues();
|
|
extern LDVImpl *makeInstrRefBasedLiveDebugValues();
|
|
|
|
extern bool debuginfoShouldUseDebugInstrRef(const Triple &T);
|
|
|
|
} // namespace llvm
|
|
|
|
#endif // LLVM_LIB_CODEGEN_LIVEDEBUGVALUES_LIVEDEBUGVALUES_H
|