Skip to content

Commit 1778669

Browse files
authored
[KeyInstr] Remove LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS CMake flag (#152735)
The CMake flag has been on by default for a month without any issues. This makes the feature support in LLVM unconditional (but does not enable the feature by default).
1 parent c8312bd commit 1778669

File tree

18 files changed

+12
-94
lines changed

18 files changed

+12
-94
lines changed

clang/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ llvm_canonicalize_cmake_booleans(
2626
PPC_LINUX_DEFAULT_IEEELONGDOUBLE
2727
LLVM_TOOL_LLVM_DRIVER_BUILD
2828
LLVM_INCLUDE_SPIRV_TOOLS_TESTS
29-
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS
3029
)
3130

3231
# Run tests requiring Z3 headers only if LLVM was built with Z3

clang/test/DebugInfo/KeyInstructions/lit.local.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

clang/test/lit.site.cfg.py.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ config.ppc_linux_default_ieeelongdouble = @PPC_LINUX_DEFAULT_IEEELONGDOUBLE@
4646
config.have_llvm_driver = @LLVM_TOOL_LLVM_DRIVER_BUILD@
4747
config.spirv_tools_tests = @LLVM_INCLUDE_SPIRV_TOOLS_TESTS@
4848
config.substitutions.append(("%llvm-version-major", "@LLVM_VERSION_MAJOR@"))
49-
config.has_key_instructions = @LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS@
5049

5150
import lit.llvm
5251
lit.llvm.initialize(lit_config, config)

llvm/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,9 +588,6 @@ set(LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING "DISABLED" CACHE STRING
588588
"Enhance Debugify's line number coverage tracking; enabling this is ABI-breaking. Can be DISABLED, COVERAGE, or COVERAGE_AND_ORIGIN.")
589589
set_property(CACHE LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING PROPERTY STRINGS DISABLED COVERAGE COVERAGE_AND_ORIGIN)
590590

591-
option(LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS
592-
"Add additional fields to DILocations to support Key Instructions" ON)
593-
594591
set(WINDOWS_PREFER_FORWARD_SLASH_DEFAULT OFF)
595592
if (MINGW)
596593
# Cygwin doesn't identify itself as Windows, and thus gets path::Style::posix

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,6 @@ endif()
212212
# LLVM_ENABLE_DEBUGLOC_TRACKING_COVERAGE (non-cached) is expected to be
213213
# 1 or 0 here, assuming referenced in #cmakedefine01.
214214

215-
if(LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS)
216-
add_compile_definitions(EXPERIMENTAL_KEY_INSTRUCTIONS)
217-
endif()
218-
219215
if( LLVM_REVERSE_ITERATION )
220216
set( LLVM_ENABLE_REVERSE_ITERATION 1 )
221217
endif()

llvm/include/llvm/IR/DebugInfoMetadata.h

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2506,10 +2506,8 @@ class DISubprogram : public DILocalScope {
25062506
class DILocation : public MDNode {
25072507
friend class LLVMContextImpl;
25082508
friend class MDNode;
2509-
#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
25102509
uint64_t AtomGroup : 61;
25112510
uint64_t AtomRank : 3;
2512-
#endif
25132511

25142512
DILocation(LLVMContext &C, StorageType Storage, unsigned Line,
25152513
unsigned Column, uint64_t AtomGroup, uint8_t AtomRank,
@@ -2539,20 +2537,8 @@ class DILocation : public MDNode {
25392537
}
25402538

25412539
public:
2542-
uint64_t getAtomGroup() const {
2543-
#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
2544-
return AtomGroup;
2545-
#else
2546-
return 0;
2547-
#endif
2548-
}
2549-
uint8_t getAtomRank() const {
2550-
#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
2551-
return AtomRank;
2552-
#else
2553-
return 0;
2554-
#endif
2555-
}
2540+
uint64_t getAtomGroup() const { return AtomGroup; }
2541+
uint8_t getAtomRank() const { return AtomRank; }
25562542

25572543
const DILocation *getWithoutAtom() const {
25582544
if (!getAtomGroup() && !getAtomRank())

llvm/lib/IR/DebugInfoMetadata.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,9 @@ DebugVariable::DebugVariable(const DbgVariableRecord *DVR)
5757
DILocation::DILocation(LLVMContext &C, StorageType Storage, unsigned Line,
5858
unsigned Column, uint64_t AtomGroup, uint8_t AtomRank,
5959
ArrayRef<Metadata *> MDs, bool ImplicitCode)
60-
: MDNode(C, DILocationKind, Storage, MDs)
61-
#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
62-
,
63-
AtomGroup(AtomGroup), AtomRank(AtomRank)
64-
#endif
65-
{
66-
#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
60+
: MDNode(C, DILocationKind, Storage, MDs), AtomGroup(AtomGroup),
61+
AtomRank(AtomRank) {
6762
assert(AtomRank <= 7 && "AtomRank number should fit in 3 bits");
68-
#endif
6963
if (AtomGroup)
7064
C.updateDILocationAtomGroupWaterline(AtomGroup + 1);
7165

llvm/lib/IR/LLVMContextImpl.h

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -312,47 +312,33 @@ template <> struct MDNodeKeyImpl<MDTuple> : MDNodeOpsKey {
312312
template <> struct MDNodeKeyImpl<DILocation> {
313313
Metadata *Scope;
314314
Metadata *InlinedAt;
315-
#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
316315
uint64_t AtomGroup : 61;
317316
uint64_t AtomRank : 3;
318-
#endif
319317
unsigned Line;
320318
uint16_t Column;
321319
bool ImplicitCode;
322320

323321
MDNodeKeyImpl(unsigned Line, uint16_t Column, Metadata *Scope,
324322
Metadata *InlinedAt, bool ImplicitCode, uint64_t AtomGroup,
325323
uint8_t AtomRank)
326-
: Scope(Scope), InlinedAt(InlinedAt),
327-
#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
328-
AtomGroup(AtomGroup), AtomRank(AtomRank),
329-
#endif
330-
Line(Line), Column(Column), ImplicitCode(ImplicitCode) {
331-
}
324+
: Scope(Scope), InlinedAt(InlinedAt), AtomGroup(AtomGroup),
325+
AtomRank(AtomRank), Line(Line), Column(Column),
326+
ImplicitCode(ImplicitCode) {}
332327

333328
MDNodeKeyImpl(const DILocation *L)
334329
: Scope(L->getRawScope()), InlinedAt(L->getRawInlinedAt()),
335-
#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
336330
AtomGroup(L->getAtomGroup()), AtomRank(L->getAtomRank()),
337-
#endif
338331
Line(L->getLine()), Column(L->getColumn()),
339-
ImplicitCode(L->isImplicitCode()) {
340-
}
332+
ImplicitCode(L->isImplicitCode()) {}
341333

342334
bool isKeyOf(const DILocation *RHS) const {
343335
return Line == RHS->getLine() && Column == RHS->getColumn() &&
344336
Scope == RHS->getRawScope() && InlinedAt == RHS->getRawInlinedAt() &&
345-
ImplicitCode == RHS->isImplicitCode()
346-
#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
347-
&& AtomGroup == RHS->getAtomGroup() &&
348-
AtomRank == RHS->getAtomRank();
349-
#else
350-
;
351-
#endif
337+
ImplicitCode == RHS->isImplicitCode() &&
338+
AtomGroup == RHS->getAtomGroup() && AtomRank == RHS->getAtomRank();
352339
}
353340

354341
unsigned getHashValue() const {
355-
#ifdef EXPERIMENTAL_KEY_INSTRUCTIONS
356342
// Hashing AtomGroup and AtomRank substantially impacts performance whether
357343
// Key Instructions is enabled or not. We can't detect whether it's enabled
358344
// here cheaply; avoiding hashing zero values is a good approximation. This
@@ -363,7 +349,6 @@ template <> struct MDNodeKeyImpl<DILocation> {
363349
if (AtomGroup || AtomRank)
364350
return hash_combine(Line, Column, Scope, InlinedAt, ImplicitCode,
365351
AtomGroup, (uint8_t)AtomRank);
366-
#endif
367352
return hash_combine(Line, Column, Scope, InlinedAt, ImplicitCode);
368353
}
369354
};

llvm/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ llvm_canonicalize_cmake_booleans(
3030
LLVM_INCLUDE_SPIRV_TOOLS_TESTS
3131
LLVM_APPEND_VC_REV
3232
LLVM_HAS_LOGF128
33-
LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS
3433
)
3534

3635
configure_lit_site_cfg(

llvm/test/DebugInfo/KeyInstructions/debugify.ll

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
; RUN: opt -passes=debugify --debugify-atoms -S -o - < %s \
22
; RUN: | FileCheck %s
33

4-
;; Mirrors llvm/test/DebugInfo/debugify.ll. Split out here because the
5-
;; test is only supported if LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS is enabled
6-
;; (which is a condition for running this test directory). Once the conditional
7-
;; compilation of the feature is removed this can be merged into the original.
4+
;; Mirrors llvm/test/DebugInfo/debugify.ll
85

96
; CHECK-LABEL: define void @foo
107
define void @foo() {

0 commit comments

Comments
 (0)