Skip to content

Commit 6aadd23

Browse files
committed
Turn off pass when using varloc-based LDV
1 parent 52b95c7 commit 6aadd23

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/CodeGen/RemoveLoadsIntoFakeUses.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
#include "llvm/IR/Function.h"
3333
#include "llvm/InitializePasses.h"
3434
#include "llvm/Support/Debug.h"
35+
#include "llvm/Target/TargetMachine.h"
36+
37+
#include "LiveDebugValues/LiveDebugValues.h"
3538

3639
using namespace llvm;
3740

@@ -74,6 +77,10 @@ INITIALIZE_PASS_END(RemoveLoadsIntoFakeUses, DEBUG_TYPE,
7477
"Remove Loads Into Fake Uses", false, false)
7578

7679
bool RemoveLoadsIntoFakeUses::runOnMachineFunction(MachineFunction &MF) {
80+
// Skip this pass if we would use VarLoc-based LDV, as there may be DBG_VALUE
81+
// instructions of the restored values that would become invalid.
82+
if (debuginfoShouldUseDebugInstrRef(MF.getTarget().getTargetTriple()))
83+
return false;
7784
// Only run this for functions that have fake uses.
7885
if (!MF.hasFakeUses() || skipFunction(MF.getFunction()))
7986
return false;

0 commit comments

Comments
 (0)