Skip to content

Commit 026fc06

Browse files
committed
Use instr-ref bit instead of high-level function
1 parent 0d4a75b commit 026fc06

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

llvm/lib/CodeGen/RemoveLoadsIntoFakeUses.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
#include "llvm/Support/Debug.h"
3535
#include "llvm/Target/TargetMachine.h"
3636

37-
#include "LiveDebugValues/LiveDebugValues.h"
38-
3937
using namespace llvm;
4038

4139
#define DEBUG_TYPE "remove-loads-into-fake-uses"
@@ -79,7 +77,7 @@ INITIALIZE_PASS_END(RemoveLoadsIntoFakeUses, DEBUG_TYPE,
7977
bool RemoveLoadsIntoFakeUses::runOnMachineFunction(MachineFunction &MF) {
8078
// Skip this pass if we would use VarLoc-based LDV, as there may be DBG_VALUE
8179
// instructions of the restored values that would become invalid.
82-
if (!MF.shouldUseDebugInstrRef())
80+
if (!MF.useDebugInstrRef())
8381
return false;
8482
// Only run this for functions that have fake uses.
8583
if (!MF.hasFakeUses() || skipFunction(MF.getFunction()))

llvm/test/CodeGen/X86/fake-use-remove-loads.mir

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
22
# Ensure that loads into FAKE_USEs are correctly removed by the
3-
# remove-loads-into-fake-uses pass.
4-
# RUN: llc -run-pass remove-loads-into-fake-uses -mtriple=x86_64-unknown-linux -debug-only=remove-loads-into-fake-uses 2>&1 -o - %s | FileCheck %s --check-prefix=ENABLED
5-
# RUN: llc -run-pass remove-loads-into-fake-uses -mtriple=x86_64-unknown-linux -debug-only=remove-loads-into-fake-uses -experimental-debug-variable-locations=false 2>&1 -o - %s | FileCheck %s --check-prefixes=DISABLED
3+
# remove-loads-into-fake-uses pass, and that if the function does not use
4+
# instruction referencing then no changes are made.
5+
# RUN: sed 's/USE_INSTR_REF/true/' %s | llc - -x mir -run-pass remove-loads-into-fake-uses -mtriple=x86_64-unknown-linux -debug-only=remove-loads-into-fake-uses 2>&1 -o - | FileCheck %s --check-prefix=ENABLED
6+
# RUN: sed 's/USE_INSTR_REF/false/' %s | llc - -x mir -run-pass remove-loads-into-fake-uses -mtriple=x86_64-unknown-linux -debug-only=remove-loads-into-fake-uses 2>&1 -o - | FileCheck %s --check-prefixes=DISABLED
67
# REQUIRES: asserts
78
#
89
## We verify that:
@@ -22,6 +23,7 @@ tracksRegLiveness: true
2223
noPhis: true
2324
noVRegs: true
2425
hasFakeUses: true
26+
debugInstrRef: USE_INSTR_REF
2527
tracksDebugUserValues: true
2628
liveins:
2729
- { reg: '$rdi', virtual-reg: '' }

0 commit comments

Comments
 (0)