AnyComdatSelectionKind ComdatSelectionKind = C.LLVMAnyComdatSelectionKind
ExactMatchComdatSelectionKind ComdatSelectionKind = C.LLVMExactMatchComdatSelectionKind
LargestComdatSelectionKind ComdatSelectionKind = C.LLVMLargestComdatSelectionKind
- NoDuplicatesComdatSelectionKind ComdatSelectionKind = C.LLVMNoDuplicatesComdatSelectionKind
+ NoDeduplicateComdatSelectionKind ComdatSelectionKind = C.LLVMNoDeduplicateComdatSelectionKind
SameSizeComdatSelectionKind ComdatSelectionKind = C.LLVMSameSizeComdatSelectionKind
)
* code 9: ``noalias``
* code 10: ``nobuiltin``
* code 11: ``nocapture``
-* code 12: ``noduplicates``
+* code 12: ``nodeduplicate``
* code 13: ``noimplicitfloat``
* code 14: ``noinline``
* code 15: ``nonlazybind``
same data.
``largest``
The linker will choose the section containing the largest COMDAT key.
-``noduplicates``
- The linker requires that only section with this COMDAT key exist.
+``nodeduplicate``
+ No deduplication is performed.
``samesize``
The linker may choose any COMDAT key but the sections must contain the
same amount of data.
///< be the same.
LLVMLargestComdatSelectionKind, ///< The linker will choose the largest
///< COMDAT.
- LLVMNoDuplicatesComdatSelectionKind, ///< No other Module may specify this
- ///< COMDAT.
+ LLVMNoDeduplicateComdatSelectionKind, ///< No deduplication is performed.
LLVMSameSizeComdatSelectionKind ///< The data referenced by the COMDAT must be
///< the same size.
} LLVMComdatSelectionKind;
kw_any,
kw_exactmatch,
kw_largest,
- kw_noduplicates,
+ kw_nodeduplicate,
kw_samesize,
kw_eq,
class Comdat {
public:
enum SelectionKind {
- Any, ///< The linker may choose any COMDAT.
- ExactMatch, ///< The data referenced by the COMDAT must be the same.
- Largest, ///< The linker will choose the largest COMDAT.
- NoDuplicates, ///< No other Module may specify this COMDAT.
- SameSize, ///< The data referenced by the COMDAT must be the same size.
+ Any, ///< The linker may choose any COMDAT.
+ ExactMatch, ///< The data referenced by the COMDAT must be the same.
+ Largest, ///< The linker will choose the largest COMDAT.
+ NoDeduplicate, ///< No deduplication is performed.
+ SameSize, ///< The data referenced by the COMDAT must be the same size.
};
Comdat(const Comdat &) = delete;
KEYWORD(any);
KEYWORD(exactmatch);
KEYWORD(largest);
- KEYWORD(noduplicates);
+ KEYWORD(nodeduplicate);
KEYWORD(samesize);
KEYWORD(eq); KEYWORD(ne); KEYWORD(slt); KEYWORD(sgt); KEYWORD(sle);
case lltok::kw_largest:
SK = Comdat::Largest;
break;
- case lltok::kw_noduplicates:
- SK = Comdat::NoDuplicates;
+ case lltok::kw_nodeduplicate:
+ SK = Comdat::NoDeduplicate;
break;
case lltok::kw_samesize:
SK = Comdat::SameSize;
case bitc::COMDAT_SELECTION_KIND_LARGEST:
return Comdat::Largest;
case bitc::COMDAT_SELECTION_KIND_NO_DUPLICATES:
- return Comdat::NoDuplicates;
+ return Comdat::NoDeduplicate;
case bitc::COMDAT_SELECTION_KIND_SAME_SIZE:
return Comdat::SameSize;
}
return bitc::COMDAT_SELECTION_KIND_EXACT_MATCH;
case Comdat::Largest:
return bitc::COMDAT_SELECTION_KIND_LARGEST;
- case Comdat::NoDuplicates:
+ case Comdat::NoDeduplicate:
return bitc::COMDAT_SELECTION_KIND_NO_DUPLICATES;
case Comdat::SameSize:
return bitc::COMDAT_SELECTION_KIND_SAME_SIZE;
return nullptr;
if (C->getSelectionKind() != Comdat::Any &&
- C->getSelectionKind() != Comdat::NoDuplicates)
+ C->getSelectionKind() != Comdat::NoDeduplicate)
report_fatal_error("ELF COMDATs only support SelectionKind::Any and "
- "SelectionKind::NoDuplicates, '" + C->getName() +
- "' cannot be lowered.");
+ "SelectionKind::NoDeduplicate, '" +
+ C->getName() + "' cannot be lowered.");
return C;
}
return COFF::IMAGE_COMDAT_SELECT_EXACT_MATCH;
case Comdat::Largest:
return COFF::IMAGE_COMDAT_SELECT_LARGEST;
- case Comdat::NoDuplicates:
+ case Comdat::NoDeduplicate:
return COFF::IMAGE_COMDAT_SELECT_NODUPLICATES;
case Comdat::SameSize:
return COFF::IMAGE_COMDAT_SELECT_SAME_SIZE;
case Comdat::Largest:
ROS << "largest";
break;
- case Comdat::NoDuplicates:
- ROS << "noduplicates";
+ case Comdat::NoDeduplicate:
+ ROS << "nodeduplicate";
break;
case Comdat::SameSize:
ROS << "samesize";
return LLVMExactMatchComdatSelectionKind;
case Comdat::Largest:
return LLVMLargestComdatSelectionKind;
- case Comdat::NoDuplicates:
- return LLVMNoDuplicatesComdatSelectionKind;
+ case Comdat::NoDeduplicate:
+ return LLVMNoDeduplicateComdatSelectionKind;
case Comdat::SameSize:
return LLVMSameSizeComdatSelectionKind;
}
case LLVMLargestComdatSelectionKind:
Cd->setSelectionKind(Comdat::Largest);
break;
- case LLVMNoDuplicatesComdatSelectionKind:
- Cd->setSelectionKind(Comdat::NoDuplicates);
+ case LLVMNoDeduplicateComdatSelectionKind:
+ Cd->setSelectionKind(Comdat::NoDeduplicate);
break;
case LLVMSameSizeComdatSelectionKind:
Cd->setSelectionKind(Comdat::SameSize);
// Go with Dst.
LinkFromSrc = false;
break;
- case Comdat::SelectionKind::NoDuplicates:
+ case Comdat::SelectionKind::NoDeduplicate:
return emitError("Linking COMDATs named '" + ComdatName +
- "': noduplicates has been violated!");
+ "': nodeduplicate has been violated!");
case Comdat::SelectionKind::ExactMatch:
case Comdat::SelectionKind::Largest:
case Comdat::SelectionKind::SameSize: {
// If a comdat with one member is not externally visible, we can drop it.
// Otherwise, the comdat can be used to establish dependencies among the
// group of sections. Thus we have to keep the comdat but switch it to
- // noduplicates.
- // Note: noduplicates is not necessary for COFF. wasm doesn't support
- // noduplicates.
+ // nodeduplicate.
+ // Note: nodeduplicate is not necessary for COFF. wasm doesn't support
+ // nodeduplicate.
ComdatInfo &Info = ComdatMap.find(C)->second;
if (Info.Size == 1)
GO->setComdat(nullptr);
else if (!IsWasm)
- C->setSelectionKind(Comdat::NoDuplicates);
+ C->setSelectionKind(Comdat::NoDeduplicate);
}
if (GV.hasLocalLinkage())
switch (C->getSelectionKind()) {
case Comdat::Any:
case Comdat::ExactMatch:
- case Comdat::NoDuplicates:
+ case Comdat::NoDeduplicate:
break;
case Comdat::Largest:
case Comdat::SameSize:
// linkage to internal linkage so that a symbol table entry is emitted. This
// is necessary in order to create the comdat group.
if (TargetTriple.isOSBinFormatCOFF()) {
- C->setSelectionKind(Comdat::NoDuplicates);
+ C->setSelectionKind(Comdat::NoDeduplicate);
if (G->hasPrivateLinkage())
G->setLinkage(GlobalValue::InternalLinkage);
}
// same name marked IMAGE_COMDAT_SELECT_ASSOCIATIVE.
//
// For ELF, when not using COMDAT, put counters, data and values into a
- // noduplicates COMDAT which is lowered to a zero-flag section group. This
+ // nodeduplicate COMDAT which is lowered to a zero-flag section group. This
// allows -z start-stop-gc to discard the entire group when the function is
// discarded.
bool DataReferencedByCode = profDataReferencedByCode(*M);
: CntsVarName;
Comdat *C = M->getOrInsertComdat(GroupName);
if (!NeedComdat)
- C->setSelectionKind(Comdat::NoDuplicates);
+ C->setSelectionKind(Comdat::NoDeduplicate);
GV->setComdat(C);
}
};
// symbols.
Comdat *C = M->getOrInsertComdat(F.getName());
if (T.isOSBinFormatELF() || (T.isOSBinFormatCOFF() && !F.isWeakForLinker()))
- C->setSelectionKind(Comdat::NoDuplicates);
+ C->setSelectionKind(Comdat::NoDeduplicate);
F.setComdat(C);
return C;
}
; CHECK: $comdat.exactmatch = comdat exactmatch
$comdat.largest = comdat largest
; CHECK: $comdat.largest = comdat largest
-$comdat.noduplicates = comdat noduplicates
-; CHECK: $comdat.noduplicates = comdat noduplicates
+$comdat.noduplicates = comdat nodeduplicate
+; CHECK: $comdat.noduplicates = comdat nodeduplicate
$comdat.samesize = comdat samesize
; CHECK: $comdat.samesize = comdat samesize
; CHECK: $comdat.exactmatch = comdat exactmatch
$comdat.largest = comdat largest
; CHECK: $comdat.largest = comdat largest
-$comdat.noduplicates = comdat noduplicates
-; CHECK: $comdat.noduplicates = comdat noduplicates
+$comdat.noduplicates = comdat nodeduplicate
+; CHECK: $comdat.noduplicates = comdat nodeduplicate
$comdat.samesize = comdat samesize
; CHECK: $comdat.samesize = comdat samesize
; CHECK: $comdat.exactmatch = comdat exactmatch
$comdat.largest = comdat largest
; CHECK: $comdat.largest = comdat largest
-$comdat.noduplicates = comdat noduplicates
-; CHECK: $comdat.noduplicates = comdat noduplicates
+$comdat.noduplicates = comdat nodeduplicate
+; CHECK: $comdat.noduplicates = comdat nodeduplicate
$comdat.samesize = comdat samesize
; CHECK: $comdat.samesize = comdat samesize
; CHECK: $comdat.exactmatch = comdat exactmatch
$comdat.largest = comdat largest
; CHECK: $comdat.largest = comdat largest
-$comdat.noduplicates = comdat noduplicates
-; CHECK: $comdat.noduplicates = comdat noduplicates
+$comdat.noduplicates = comdat nodeduplicate
+; CHECK: $comdat.noduplicates = comdat nodeduplicate
$comdat.samesize = comdat samesize
; CHECK: $comdat.samesize = comdat samesize
; CHECK: $comdat.exactmatch = comdat exactmatch
$comdat.largest = comdat largest
; CHECK: $comdat.largest = comdat largest
-$comdat.noduplicates = comdat noduplicates
-; CHECK: $comdat.noduplicates = comdat noduplicates
+$comdat.noduplicates = comdat nodeduplicate
+; CHECK: $comdat.noduplicates = comdat nodeduplicate
$comdat.samesize = comdat samesize
; CHECK: $comdat.samesize = comdat samesize
; CHECK: $comdat.exactmatch = comdat exactmatch
$comdat.largest = comdat largest
; CHECK: $comdat.largest = comdat largest
-$comdat.noduplicates = comdat noduplicates
-; CHECK: $comdat.noduplicates = comdat noduplicates
+$comdat.noduplicates = comdat nodeduplicate
+; CHECK: $comdat.noduplicates = comdat nodeduplicate
$comdat.samesize = comdat samesize
; CHECK: $comdat.samesize = comdat samesize
; CHECK: $comdat.exactmatch = comdat exactmatch
$comdat.largest = comdat largest
; CHECK: $comdat.largest = comdat largest
-$comdat.noduplicates = comdat noduplicates
-; CHECK: $comdat.noduplicates = comdat noduplicates
+$comdat.noduplicates = comdat nodeduplicate
+; CHECK: $comdat.noduplicates = comdat nodeduplicate
$comdat.samesize = comdat samesize
; CHECK: $comdat.samesize = comdat samesize
; CHECK: $comdat.exactmatch = comdat exactmatch
$comdat.largest = comdat largest
; CHECK: $comdat.largest = comdat largest
-$comdat.noduplicates = comdat noduplicates
-; CHECK: $comdat.noduplicates = comdat noduplicates
+$comdat.noduplicates = comdat nodeduplicate
+; CHECK: $comdat.noduplicates = comdat nodeduplicate
$comdat.samesize = comdat samesize
; CHECK: $comdat.samesize = comdat samesize
ret void
}
-$f4 = comdat noduplicates
+$f4 = comdat nodeduplicate
@v4 = global i32 0, comdat($f4)
define void @f4() comdat($f4) {
ret void
-; Checks that comdat with noduplicates kind is lowered to a zero-flag ELF
+; Checks that comdat with nodeduplicate kind is lowered to a zero-flag ELF
; section group.
; RUN: llc < %s -mtriple=x86_64-unknown-linux | FileCheck %s
; CHECK: .section .text.f2,"axG",@progbits,f1{{$}}
; CHECK: .section .bss.g1,"aGw",@nobits,f1{{$}}
-$f1 = comdat noduplicates
+$f1 = comdat nodeduplicate
define void @f1() comdat {
unreachable
resume { i8*, i32 } %0
}
-;; If the function is in a comdat group with noduplicates kind, the generated
+;; If the function is in a comdat group with nodeduplicate kind, the generated
;; .gcc_except_table should is lowered to a zero-flag ELF section group.
-$zero = comdat noduplicates
+$zero = comdat nodeduplicate
define i32 @zero() uwtable comdat personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
; CHECK-LABEL: zero:
; CHECK: .cfi_endproc
$mystr = comdat any
-; CHECK: $dead_global = comdat noduplicates
-; CHECK: $private_str = comdat noduplicates
+; CHECK: $dead_global = comdat nodeduplicate
+; CHECK: $private_str = comdat nodeduplicate
; CHECK: @dead_global = global { i32, [28 x i8] } { i32 42, [28 x i8] zeroinitializer }, comdat, align 32
; CHECK: @private_str = internal constant { [8 x i8], [24 x i8] } { [8 x i8] c"private\00", [24 x i8] zeroinitializer }, comdat, align 32
; MACHO: @__llvm_profile_runtime = external global i32
; ELF-NOT: @__llvm_profile_runtime = external global i32
-; ELF: $__profc_foo = comdat noduplicates
-; ELF: $__profc_foo_weak = comdat noduplicates
-; ELF: $"__profc_linkage.ll:foo_internal" = comdat noduplicates
-; ELF: $__profc_foo_inline = comdat noduplicates
+; ELF: $__profc_foo = comdat nodeduplicate
+; ELF: $__profc_foo_weak = comdat nodeduplicate
+; ELF: $"__profc_linkage.ll:foo_internal" = comdat nodeduplicate
+; ELF: $__profc_foo_inline = comdat nodeduplicate
; ELF: $__profc_foo_extern = comdat any
@__profn_foo = private constant [3 x i8] c"foo"
; Both new comdats should no duplicates on COFF.
-; CHECK: $foo = comdat noduplicates
-; CHECK: $bar = comdat noduplicates
+; CHECK: $foo = comdat nodeduplicate
+; CHECK: $bar = comdat nodeduplicate
; Tables for 'foo' should be in the 'foo' comdat.
; RUN: opt < %s -sancov -sanitizer-coverage-level=1 -sanitizer-coverage-inline-bool-flag=1 -S -enable-new-pm=0 | FileCheck %s
; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=1 -sanitizer-coverage-inline-bool-flag=1 -S | FileCheck %s
-; CHECK: $foo = comdat noduplicates
+; CHECK: $foo = comdat nodeduplicate
; CHECK: @__sancov_gen_ = private global [1 x i1] zeroinitializer, section "__sancov_bools", comdat($foo), align 1{{$}}
; CHECK: @__start___sancov_bools = extern_weak hidden global i1
; CHECK-NEXT: @__stop___sancov_bools = extern_weak hidden global i1
ret void
}
-; CHECK: $Vanilla = comdat noduplicates
-; ELF: $LinkOnceOdr = comdat noduplicates
+; CHECK: $Vanilla = comdat nodeduplicate
+; ELF: $LinkOnceOdr = comdat nodeduplicate
; COFF: $LinkOnceOdr = comdat any
; CHECK: @__sancov_gen_ = private global [1 x i32] zeroinitializer, section {{.*}}, comdat($Vanilla), align 4{{$}}
; CHECK-NEXT: @__sancov_gen_.1 = private global [1 x i32] zeroinitializer, section {{.*}}, align 4{{$}}
; RUN: opt < %s -passes='module(sancov-module)' -sanitizer-coverage-level=4 -sanitizer-coverage-trace-pc-guard -mtriple=x86_64-windows -S | FileCheck %s --check-prefixes=CHECK,COMDAT,WIN
-; COMDAT: $foo = comdat noduplicates
-; COMDAT: $CallViaVptr = comdat noduplicates
+; COMDAT: $foo = comdat nodeduplicate
+; COMDAT: $CallViaVptr = comdat nodeduplicate
; ELF: @__sancov_gen_ = private global [3 x i32] zeroinitializer, section "__sancov_guards", comdat($foo), align 4{{$}}
; ELF-NEXT: @__sancov_gen_.1 = private global [1 x i32] zeroinitializer, section "__sancov_guards", comdat($CallViaVptr), align 4{{$}}
-$foo = comdat noduplicates
+$foo = comdat nodeduplicate
@foo = global i64 43, comdat($foo)
; RUN: not llvm-link %s %p/Inputs/comdat3.ll -S -o - 2>&1 | FileCheck %s
-$foo = comdat noduplicates
+$foo = comdat nodeduplicate
@foo = global i64 43, comdat($foo)
-; CHECK: Linking COMDATs named 'foo': noduplicates has been violated!
+; CHECK: Linking COMDATs named 'foo': nodeduplicate has been violated!
$source_comdat_variable = comdat largest
@source_comdat_variable = global i32 32, comdat($source_comdat_variable)
-$source_comdat_variable_1 = comdat noduplicates
+$source_comdat_variable_1 = comdat nodeduplicate
@source_comdat_variable_1 = global i32 64, comdat($source_comdat_variable_1)
; CHECK: $target_comdat_function = comdat any
; CHECK: $target_comdat_function_1 = comdat exactmatch
; CHECK: $target_comdat_variable = comdat largest
-; CHECK: $target_comdat_variable_1 = comdat noduplicates
+; CHECK: $target_comdat_variable_1 = comdat nodeduplicate
; CHECK: @target_variable = external global i32
; CHECK-NOT: @source_variable = external global i32
; CHECK: $c1 = comdat any
-;; wasm doesn't support noduplicates.
-; NODUP: $c2 = comdat noduplicates
+;; wasm doesn't support nodeduplicate.
+; NODUP: $c2 = comdat nodeduplicate
; WASM: $c2 = comdat any
; CHECK: $c3 = comdat any